RECIPE 035
구글 시트 리드 데이터 → HubSpot 대량 동기화
- ▸Google Calendar API로 일정 목록을 자동으로 수집할 수 있다
- ▸수집된 일정 데이터를 Google Sheets에 자동 기록할 수 있다
- ▸월간/주간 일정 통계를 자동으로 계산할 수 있다
✅사전 준비
- □Google Calendar 자격증명 연결 완료
- □Google Sheets 자격증명 연결 완료
- □Sheets에 일정 기록용 시트 생성 (제목/시작/종료/참석자/카테고리 컬럼)
- □Schedule Trigger: 매일 자정 (Cron: 0 0 * * *)
Calendar 이벤트 수집 — Google Calendar 노드
Resource: Event
Operation: Get All
Options:
Time Min: {{ $now.startOf('day').toISO() }}
Time Max: {{ $now.endOf('day').toISO() }}
Max Results: 50
Single Events: true
Order By: startTime이벤트 데이터 정제 — Code 노드
const items = $input.all();
return items.map(({ json }) => ({
json: {
제목: json.summary ?? '(제목없음)',
시작: json.start?.dateTime ?? json.start?.date,
종료: json.end?.dateTime ?? json.end?.date,
참석자: json.attendees?.map(a => a.email).join(', ') ?? '',
장소: json.location ?? '',
소요시간분: json.start?.dateTime
? Math.round((new Date(json.end.dateTime) - new Date(json.start.dateTime)) / 60000)
: 0,
기록일시: new Date().toLocaleDateString('ko-KR'),
}
}));💡 TIP종일 이벤트는 dateTime이 아닌 date 필드만 있습니다. 두 경우를 모두 처리하려면 json.start?.dateTime ?? json.start?.date 패턴으로 fallback 처리하세요.
⚡
워크플로우 JSON
아래 JSON을 복사해 n8n에 바로 임포트하세요
📥 n8n 임포트 방법
n8n 화면 우측 상단 메뉴 (⋮) → Import from JSON → 아래 JSON 전체 복사 후 붙여넣기 → Import 클릭
n8n 화면 우측 상단 메뉴 (⋮) → Import from JSON → 아래 JSON 전체 복사 후 붙여넣기 → Import 클릭
{
"recipeId": "recipe035",
"title": "구글 시트 리드 데이터 → HubSpot 대량 동기화",
"chapter": 3,
"category": "영업 & 리드 관리 자동화",
"difficulty": "⭐⭐",
"estimatedTime": "35분",
"description": "구글 시트에 있는 리드 데이터를 HubSpot으로 대량 동기화합니다. 이미 존재하는 연락처는 업데이트하고 없으면 새로 생성하는 Upsert 방식으로 처리하며, 처리 완료 건수를 Slack으로 알립니다.",
"apps": [
"Google Sheets",
"HubSpot",
"Slack"
],
"nodes": [
{
"id": "sheets_read",
"type": "action",
"name": "Google Sheets - 리드 데이터 전체 읽기",
"service": "googleSheets",
"config": {
"operation": "readAllRows",
"documentId": "={{ $env.LEAD_SHEET_ID }}",
"sheetName": "리드목록"
}
},
{
"id": "hubspot_upsert",
"type": "action",
"name": "HubSpot - Contact Upsert",
"service": "hubspot",
"config": {
"operation": "upsert",
"contactFields": {
"email": "={{ $json[\"이메일\"] }}",
"firstname": "={{ $json[\"이름\"] }}",
"company": "={{ $json[\"회사명\"] }}",
"phone": "={{ $json[\"연락처\"] }}",
"jobtitle": "={{ $json[\"직함\"] }}"
}
}
},
{
"id": "slack_complete",
"type": "action",
"name": "Slack - 동기화 완료 알림",
"service": "slack",
"config": {
"channel": "={{ $env.SLACK_SALES_CHANNEL }}",
"message": "✅ HubSpot 리드 동기화 완료!\n처리 건수: {{ $items().length }}건\n완료 시간: {{ $now.format(\"MM/DD HH:mm\") }}"
}
}
],
"connections": [
{
"from": "sheets_read",
"to": "hubspot_upsert"
},
{
"from": "hubspot_upsert",
"to": "slack_complete"
}
],
"envVars": [
{
"key": "LEAD_SHEET_ID",
"description": "리드 데이터 구글 시트 ID"
},
{
"key": "SLACK_SALES_CHANNEL",
"description": "영업팀 Slack 채널 ID"
}
],
"qrCodeUrl": "https://www.koreaaitimes.com/books/n8n-vol2/recipe035"
}