발행일: 2026-10-06(화) 11:44
← 목차로 돌아가기|하루 30분 n8n 시리즈 ② 실무 자동화 레시피 100
RECIPE P3

미니 프로젝트 — 스타트업 영업팀의 리드-to-클로즈 자동화

  • ▸리드 유입부터 계약 체결까지 전 단계를 n8n으로 연결할 수 있다
  • ▸HubSpot CRM 파이프라인 단계 변경을 트리거로 후속 작업을 자동화할 수 있다
  • ▸영업 팀장에게 실시간 파이프라인 현황을 자동 리포팅할 수 있다

✅사전 준비

  • □HubSpot API 키 및 자격증명 연결 완료
  • □CRM 파이프라인 단계 정의 (리드→검토→제안→협상→클로즈)
  • □레시피 026~040 핵심 워크플로우 동작 확인
  • □PDF 생성 서비스 API 키 준비 (html2pdf.app 등)
  • □Slack #sales 채널 Webhook URL 준비

리드-to-클로즈 전체 흐름

[단계 1] 리드 유입
  광고 폼 Webhook → HubSpot 연락처 생성
  → 담당자 자동 배정 → 환영 이메일 발송

[단계 2] 제안 단계 진입
  HubSpot Trigger (stage: 제안)
  → PDF 견적서 자동 생성 → 이메일 발송
  → Slack 알림 (#sales)

[단계 3] 클로즈 완료
  HubSpot Trigger (stage: 클로즈)
  → 계약서 생성 → 온보딩 Notion 페이지 생성
  → 팀 축하 Slack 메시지

[단계 4] 주간 리포트 (매주 금 17:00)
  Schedule → HubSpot API 파이프라인 조회
  → Code 노드 집계 → Slack 리포트 발송

HubSpot Trigger 설정 (단계 변경 감지)

Resource:    Deal
Event:       Deal Stage Updated
Filter:
  - pipeline:     영업 파이프라인
  - toStage:      제안 (또는 클로즈)

출력 주요 필드:
  dealId:       {{ $json.objectId }}
  dealName:     {{ $json.properties.dealname }}
  amount:       {{ $json.properties.amount }}
  contactEmail: {{ $json.associations.contacts[0].email }}

주간 파이프라인 집계 — Code 노드

const deals = $input.all();

const summary = {
  total:     deals.length,
  leads:     deals.filter(d => d.json.stage === 'lead').length,
  proposal:  deals.filter(d => d.json.stage === 'proposal').length,
  negotiation: deals.filter(d => d.json.stage === 'negotiation').length,
  closed:    deals.filter(d => d.json.stage === 'closed').length,
  totalAmount: deals
    .filter(d => d.json.stage === 'closed')
    .reduce((sum, d) => sum + Number(d.json.amount || 0), 0),
};

const msg =
`📊 *주간 영업 파이프라인 현황*

전체 딜:    ${summary.total}건
├ 리드:     ${summary.leads}건
├ 제안:     ${summary.proposal}건
├ 협상:     ${summary.negotiation}건
└ 클로즈:   ${summary.closed}건

💰 이번 주 클로즈 금액: ${summary.totalAmount.toLocaleString()}원`;

return [{ json: { message: msg } }];
💡 TIPHubSpot 무료 플랜은 Webhook Trigger를 지원하지 않습니다. 무료 플랜이라면 Schedule Trigger로 5분마다 HubSpot Deal API를 폴링하고, 이전 상태와 비교해 변경된 딜만 처리하는 방식으로 대체하세요.
⚠️ 주의견적 PDF에 고객 개인정보(이름, 연락처, 금액)가 포함됩니다. html2pdf.app 같은 외부 서비스 사용 시 개인정보처리방침을 반드시 확인하고, 민감 데이터는 생성 후 즉시 삭제 요청 옵션을 활성화하세요.
⚡

워크플로우 JSON

아래 JSON을 복사해 n8n에 바로 임포트하세요

📥 n8n 임포트 방법
n8n 화면 우측 상단 메뉴 (⋮) → Import from JSON → 아래 JSON 전체 복사 후 붙여넣기 → Import 클릭
{
  "recipeId": "recipe040p",
  "title": "스타트업 영업팀의 리드-to-클로즈 자동화",
  "chapter": 3,
  "category": "영업 & 리드 관리 자동화",
  "type": "mini-project",
  "difficulty": "⭐⭐⭐",
  "estimatedTime": "90분",
  "description": "리드 유입부터 팔로업, 견적 발송, 계약 완료 후 온보딩까지 영업 사이클 전체를 하나의 파이프라인으로 연결합니다. 광고에서 리드가 들어오는 순간부터 계약 완료까지 사람 손을 거치지 않고 자동으로 처리되는 리드-to-클로즈 풀 자동화 시스템입니다.",
  "linkedRecipes": [
    "recipe026",
    "recipe027",
    "recipe034",
    "recipe028",
    "recipe030",
    "recipe032",
    "recipe037",
    "recipe040"
  ],
  "pipeline": [
    {
      "phase": "Day 1: 리드 유입",
      "description": "광고 리드 폼 제출 → CRM 등록 + 담당자 배정",
      "recipe": "recipe026"
    },
    {
      "phase": "Day 1~3: 초기 팔로업",
      "description": "즉시 팔로업 이메일 → 3일 후 추가 팔로업",
      "recipe": "recipe027"
    },
    {
      "phase": "미팅 이후: 팔로업",
      "description": "미팅 캘린더 종료 → 1시간 후 감사 이메일",
      "recipe": "recipe034"
    },
    {
      "phase": "견적 단계",
      "description": "견적 요청 → PDF 생성 → 자동 발송",
      "recipe": "recipe028"
    },
    {
      "phase": "계약 완료",
      "description": "HubSpot 딜 완료 → 온보딩 시작 알림 발송",
      "recipe": "recipe030"
    },
    {
      "phase": "주간 보고",
      "description": "파이프라인 현황 + 팀 순위 + 목표 달성률",
      "recipes": [
        "recipe032",
        "recipe037",
        "recipe040"
      ]
    }
  ],
  "nodes": [
    {
      "id": "trigger_fb_lead",
      "type": "trigger",
      "name": "Facebook Lead Ads Trigger",
      "service": "facebookLeadAds",
      "config": {
        "event": "newLead"
      }
    },
    {
      "id": "hubspot_create",
      "type": "action",
      "name": "HubSpot - Contact & Deal 생성",
      "service": "hubspot",
      "config": {
        "operation": "upsert"
      }
    },
    {
      "id": "if_region",
      "type": "condition",
      "name": "지역 조건 분기",
      "config": {
        "field": "={{ $json[\"region\"] }}",
        "operator": "contains",
        "value": "서울|경기|인천"
      }
    },
    {
      "id": "slack_assign",
      "type": "action",
      "name": "Slack - 담당자 배정 알림",
      "service": "slack",
      "config": {
        "channel": "={{ $env.SLACK_SALES_DM }}"
      }
    },
    {
      "id": "wait_30min",
      "type": "wait",
      "name": "30분 대기",
      "config": {
        "amount": 30,
        "unit": "minutes"
      }
    },
    {
      "id": "gmail_followup",
      "type": "action",
      "name": "Gmail - 팔로업 이메일",
      "service": "gmail",
      "config": {}
    },
    {
      "id": "trigger_deal_closed",
      "type": "trigger",
      "name": "HubSpot Trigger - 딜 계약 완료",
      "service": "hubspot",
      "config": {
        "event": "deal.propertyChange",
        "property": "dealstage",
        "toValue": "closedwon"
      }
    },
    {
      "id": "onboarding_start",
      "type": "action",
      "name": "Slack + Gmail - 온보딩 시작",
      "service": "slack",
      "config": {}
    }
  ],
  "connections": [
    {
      "from": "trigger_fb_lead",
      "to": "hubspot_create"
    },
    {
      "from": "hubspot_create",
      "to": "if_region"
    },
    {
      "from": "if_region",
      "to": "slack_assign",
      "branch": "true"
    },
    {
      "from": "slack_assign",
      "to": "wait_30min"
    },
    {
      "from": "wait_30min",
      "to": "gmail_followup"
    },
    {
      "from": "trigger_deal_closed",
      "to": "onboarding_start"
    }
  ],
  "envVars": [
    {
      "key": "SLACK_SALES_DM",
      "description": "영업사원 Slack DM 채널 ID"
    },
    {
      "key": "SLACK_SALES_CHANNEL",
      "description": "영업팀 전체 Slack 채널 ID"
    }
  ],
  "qrCodeUrl": "https://www.koreaaitimes.com/books/n8n-vol2/recipe040p"
}
← 이전 레시피☰ 목차다음 레시피 →