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

신규 리드 24시간 내 자동 팔로업 이메일

  • ▸Airtable과 Google Sheets 간 데이터를 주기적으로 동기화할 수 있다
  • ▸양쪽의 변경사항을 감지해 충돌 없이 업데이트할 수 있다
  • ▸신규/수정/삭제 레코드를 각각 다르게 처리할 수 있다

✅사전 준비

  • □Airtable Personal Access Token 및 자격증명 등록
  • □Google Sheets 자격증명 연결 완료
  • □동기화 기준 필드 확정 (예: 고유 ID, 이메일)
  • □Sheets에 'last_synced' 컬럼 추가
  • □Schedule Trigger: 1시간 간격 (Cron: 0 * * * *)

Airtable → Sheets 동기화 로직 — Code 노드

const airtableRecords = $('Airtable').all().map(i => i.json);
const sheetsRecords = $('Google Sheets').all().map(i => i.json);

const sheetsMap = new Map(sheetsRecords.map(r => [r.고유ID, r]));

const toCreate = [];
const toUpdate = [];

airtableRecords.forEach(record => {
  const existing = sheetsMap.get(record.고유ID);
  if (!existing) {
    toCreate.push(record);
  } else if (record.수정일시 > existing.last_synced) {
    toUpdate.push(record);
  }
});

return [
  ...toCreate.map(j => ({ json: { ...j, _action: 'create' } })),
  ...toUpdate.map(j => ({ json: { ...j, _action: 'update' } })),
];

액션별 분기 — Switch 노드

Value: {{ $json._action }}

Case 'create' → Sheets Append Row
Case 'update' → Sheets Update Row (행 번호 매칭 필요)
⚠️ 주의양방향 동기화는 충돌(conflict) 처리가 핵심입니다. 처음엔 단방향(Airtable → Sheets)으로 시작하고, 안정화된 후 역방향을 추가하는 방식을 권장합니다.
⚡

워크플로우 JSON

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

📥 n8n 임포트 방법
n8n 화면 우측 상단 메뉴 (⋮) → Import from JSON → 아래 JSON 전체 복사 후 붙여넣기 → Import 클릭
{
  "recipeId": "recipe027",
  "title": "신규 리드 24시간 내 자동 팔로업 이메일",
  "chapter": 3,
  "category": "영업 & 리드 관리 자동화",
  "difficulty": "⭐⭐",
  "estimatedTime": "30분",
  "description": "HubSpot에 신규 리드가 생성되면 30분 뒤 개인화된 팔로업 이메일을 Gmail로 자동 발송합니다. 즉시 발송보다 자연스러운 타이밍을 만들어줍니다.",
  "apps": [
    "HubSpot",
    "Gmail"
  ],
  "nodes": [
    {
      "id": "trigger_hubspot",
      "type": "trigger",
      "name": "HubSpot Trigger - 신규 Contact 생성",
      "service": "hubspot",
      "config": {
        "event": "contact.creation"
      }
    },
    {
      "id": "wait_30min",
      "type": "wait",
      "name": "30분 대기",
      "config": {
        "amount": 30,
        "unit": "minutes"
      }
    },
    {
      "id": "gmail_followup",
      "type": "action",
      "name": "Gmail - 팔로업 이메일 발송",
      "service": "gmail",
      "config": {
        "to": "={{ $json[\"email\"] }}",
        "subject": "[{{ $json[\"company\"] }}] 문의 주셔서 감사합니다, {{ $json[\"firstname\"] }}님!",
        "body": "안녕하세요, {{ $json[\"firstname\"] }}님.\n\n{{ $json[\"company\"] }}에 관심 가져주셔서 감사해요.\n담당자 {{ $env.SALES_REP_NAME }}이 오늘 중으로 직접 연락드리겠습니다.\n\n감사합니다."
      }
    }
  ],
  "connections": [
    {
      "from": "trigger_hubspot",
      "to": "wait_30min"
    },
    {
      "from": "wait_30min",
      "to": "gmail_followup"
    }
  ],
  "envVars": [
    {
      "key": "SALES_REP_NAME",
      "description": "담당 영업사원 이름"
    }
  ],
  "qrCodeUrl": "https://www.koreaaitimes.com/books/n8n-vol2/recipe027"
}
← 이전 레시피☰ 목차다음 레시피 →