RECIPE 018
리드 점수 자동 계산 → CRM 업데이트
- ▸HTTP Request로 서비스 URL에 주기적으로 헬스체크를 할 수 있다
- ▸응답 코드와 응답 시간으로 서버 상태를 판단할 수 있다
- ▸다운 감지 시 Slack + 이메일로 즉시 이중 알림을 보낼 수 있다
✅사전 준비
- □모니터링할 서비스 URL 목록 준비
- □Slack 자격증명 연결 완료
- □Gmail 자격증명 연결 완료
- □Schedule Trigger: 5분 간격 (Cron: */5 * * * *)
- □Google Sheets에 다운 이력 기록용 시트 생성 (선택)
모니터링 URL 목록 — Code 노드
return [
{ json: { name: "메인 사이트", url: "https://www.mysite.com" } },
{ json: { name: "API 서버", url: "https://api.mysite.com/health" } },
{ json: { name: "어드민 패널", url: "https://admin.mysite.com" } },
];HTTP Request — 헬스체크 설정
Method: GET
URL: {{ $json.url }}
Timeout: 10000 (10초)
Options:
Ignore SSL Issues: false
Response Format: JSON (실패해도 계속 진행)상태 판단 — IF 노드 조건
정상:
{{ $json.statusCode >= 200 && $json.statusCode < 300 }}
다운 (비정상 응답):
{{ $json.statusCode >= 400 || $json.statusCode === undefined }}Slack 다운 알림 메시지
🔴 *서버 다운 감지!*
서비스: {{ $json.name }}
URL: {{ $json.url }}
상태코드: {{ $json.statusCode ?? "응답 없음" }}
감지시각: {{ $now.toFormat("yyyy-MM-dd HH:mm:ss") }}
@channel 즉시 확인 바랍니다.💡 TIP에러가 발생해도 워크플로우가 멈추지 않도록 HTTP Request 노드의 'Continue on Fail' 옵션을 ON으로 설정하세요. 그래야 여러 URL을 순서대로 체크할 수 있어요.
⚡
워크플로우 JSON
아래 JSON을 복사해 n8n에 바로 임포트하세요
📥 n8n 임포트 방법
n8n 화면 우측 상단 메뉴 (⋮) → Import from JSON → 아래 JSON 전체 복사 후 붙여넣기 → Import 클릭
n8n 화면 우측 상단 메뉴 (⋮) → Import from JSON → 아래 JSON 전체 복사 후 붙여넣기 → Import 클릭
{
"name": "recipe018_lead_score_crm_update",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "cronExpression",
"expression": "0 8 * * *"
}
]
}
},
"id": "schedule-018-01",
"name": "매일 오전 8시",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.1,
"position": [
200,
400
]
},
{
"parameters": {
"resource": "contact",
"operation": "getAll",
"returnAll": false,
"limit": 100,
"additionalFields": {
"filters": {
"filterGroups": [
{
"filters": [
{
"propertyName": "lastmodifieddate",
"operator": "GT",
"value": "={{ $now.minus({days:1}).toISO() }}"
}
]
}
]
}
}
},
"id": "hubspot-018-02",
"name": "HubSpot 최근 활동 리드 조회",
"type": "n8n-nodes-base.hubspot",
"typeVersion": 2.1,
"position": [
420,
400
]
},
{
"parameters": {
"jsCode": "const item = $json;\nconst score =\n (item.properties?.hs_email_open ? 2 : 0) +\n (item.properties?.hs_email_click ? 3 : 0) +\n (item.properties?.num_contacted_notes > 0 ? 5 : 0) +\n (item.properties?.hs_analytics_num_page_views > 5 ? 5 : 0);\nreturn [{ json: { ...item, lead_score: score, isHot: score >= 10 } }];"
},
"id": "code-018-03",
"name": "리드 점수 계산",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
640,
400
]
},
{
"parameters": {
"conditions": {
"conditions": [
{
"leftValue": "={{ $json.isHot }}",
"rightValue": true,
"operator": {
"type": "boolean",
"operation": "equals"
}
}
]
}
},
"id": "if-018-04",
"name": "핫 리드 여부 확인",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [
860,
400
]
},
{
"parameters": {
"resource": "contact",
"operation": "update",
"contactId": "={{ $json.id }}",
"additionalFields": {
"lifecycleStage": "salesqualifiedlead",
"customProperties": [
{
"property": "lead_score",
"value": "={{ $json.lead_score }}"
}
]
}
},
"id": "hubspot-018-05",
"name": "HubSpot 핫 리드 업데이트",
"type": "n8n-nodes-base.hubspot",
"typeVersion": 2.1,
"position": [
1080,
300
]
},
{
"parameters": {
"resource": "message",
"operation": "post",
"channel": "#sales-leads",
"text": "=🔥 핫 리드 감지!\n이름: {{ $json.properties.firstname }} {{ $json.properties.lastname }}\n이메일: {{ $json.properties.email }}\n리드 점수: {{ $json.lead_score }}점\n→ 지금 바로 연락해보세요!"
},
"id": "slack-018-06",
"name": "영업팀 즉시 알림",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.2,
"position": [
1080,
500
]
}
],
"connections": {
"매일 오전 8시": {
"main": [
[
{
"node": "HubSpot 최근 활동 리드 조회",
"type": "main",
"index": 0
}
]
]
},
"HubSpot 최근 활동 리드 조회": {
"main": [
[
{
"node": "리드 점수 계산",
"type": "main",
"index": 0
}
]
]
},
"리드 점수 계산": {
"main": [
[
{
"node": "핫 리드 여부 확인",
"type": "main",
"index": 0
}
]
]
},
"핫 리드 여부 확인": {
"main": [
[
{
"node": "HubSpot 핫 리드 업데이트",
"type": "main",
"index": 0
}
],
[]
]
},
"HubSpot 핫 리드 업데이트": {
"main": [
[
{
"node": "영업팀 즉시 알림",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"timezone": "Asia/Seoul"
},
"meta": {
"chapter": 2,
"recipe": "018",
"title": "리드 점수 자동 계산 → CRM 업데이트",
"difficulty": "⭐⭐⭐",
"estimatedTime": "50분",
"apps": [
"HubSpot",
"Google Sheets",
"Slack"
]
}
}