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

PDF 계약서 자동 생성 → 전자서명 요청

  • ▸Notion/Sheets의 계약 데이터로 PDF 계약서 자동 생성
  • ▸DocuSign 또는 이메일로 전자서명 자동 요청
  • ▸서명 완료 시 Notion 상태 자동 업데이트

✅사전 준비

  • □계약서 HTML 템플릿 작성 (플레이스홀더 포함)
  • □html2pdf.app 또는 Puppeteer API 설정
  • □DocuSign Developer 계정 또는 이메일 서명 방식 선택
  • □Notion 계약 DB 구성 (속성: 계약명, 고객사, 금액, 시작일, 상태)

HTML 템플릿에 데이터 주입

// Code 노드 - 계약서 HTML 생성
const template = `
<!DOCTYPE html>
<html>
<body>
  <h1>서비스 이용 계약서</h1>
  <p>계약 당사자: <strong>${$json.client_name}</strong></p>
  <p>계약 기간: ${$json.start_date} ~ ${$json.end_date}</p>
  <p>계약 금액: ${$json.amount.toLocaleString()}원 (VAT 별도)</p>
  <p>서비스 범위: ${$json.scope}</p>
  <br/>
  <p>서명: ___________________</p>
  <p>날짜: ${new Date().toLocaleDateString('ko-KR')}</p>
</body>
</html>
`;

return [{ json: { html: template, filename: `contract_${$json.client_name}_${$now.toFormat('yyyyMMdd')}.pdf` } }];

PDF 생성 API 호출

Node: HTTP Request
Method: POST
URL: https://api.html2pdf.app/v1/generate
Body:
{
  "html": "{{ $json.html }}",
  "apiKey": "YOUR_API_KEY",
  "filename": "{{ $json.filename }}",
  "paperSize": "A4",
  "marginTop": "20mm",
  "marginBottom": "20mm"
}
💡 TIP무료 전자서명이 필요하다면 DocuSign 대신 이메일에 서명 이미지 첨부 요청 방식을 사용하거나, HelloSign(현 Dropbox Sign)의 무료 티어(월 3건)를 활용하세요.
⚡

워크플로우 JSON

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

📥 n8n 임포트 방법
n8n 화면 우측 상단 메뉴 (⋮) → Import from JSON → 아래 JSON 전체 복사 후 붙여넣기 → Import 클릭
{
  "recipeId": "recipe075",
  "title": "콘텐츠 발행 캘린더 D-2 리마인더",
  "chapter": 7,
  "category": "콘텐츠 & 미디어 자동화",
  "difficulty": "⭐",
  "estimatedTime": "20분",
  "usedApps": [
    "Notion",
    "Slack"
  ],
  "description": "매일 오전 9시 Notion 콘텐츠 캘린더에서 발행 예정일이 2일 후이고 상태가 '작성 중'인 항목을 자동 조회해, 담당자 Slack DM에 '이거 준비됐나요?' 리마인더 메시지를 자동 발송합니다.",
  "nodes": [
    {
      "id": "node1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "name": "매일 오전 9시 실행",
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 9 * * *"
            }
          ]
        }
      }
    },
    {
      "id": "node2",
      "type": "n8n-nodes-base.notion",
      "name": "D-2 미완성 콘텐츠 조회",
      "parameters": {
        "resource": "databasePage",
        "operation": "getAll",
        "databaseId": "={{$env.NOTION_CONTENT_DB_ID}}",
        "filterType": "manual",
        "filters": {
          "conditions": [
            {
              "key": "발행일",
              "type": "date",
              "operation": "equals",
              "value": "={{$now.plus({days: 2}).format('YYYY-MM-DD')}}"
            },
            {
              "key": "상태",
              "type": "select",
              "operation": "equals",
              "value": "작성 중"
            }
          ]
        }
      }
    },
    {
      "id": "node3",
      "type": "n8n-nodes-base.if",
      "name": "리마인더 대상 있음?",
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{$items().length}}",
              "operation": "largerEqual",
              "value2": 1
            }
          ]
        }
      }
    },
    {
      "id": "node4",
      "type": "n8n-nodes-base.slack",
      "name": "담당자 Slack DM 발송",
      "parameters": {
        "channel": "={{$json['properties']['담당자슬랙ID']['rich_text'][0]['plain_text']}}",
        "text": "📅 콘텐츠 발행 D-2 리마인더!\n\n*{{$json['properties']['제목']['title'][0]['plain_text']}}*\n발행 예정일: {{$now.plus({days: 2}).format('MM월 DD일')}}\n\n준비가 완료되면 Notion 상태를 '검토 완료'로 변경해주세요!"
      }
    }
  ],
  "envVariables": {
    "NOTION_CONTENT_DB_ID": "Notion 콘텐츠 캘린더 데이터베이스 ID"
  },
  "tips": [
    "Notion 데이터베이스에 '담당자슬랙ID' 속성을 추가해두면 담당자별 개인 DM 발송이 가능해요.",
    "Google Sheets 기반 콘텐츠 캘린더를 사용하는 분은 Notion 노드 대신 Google Sheets 노드로 동일하게 구성할 수 있어요.",
    "D-7 리마인더도 별도 Schedule Trigger로 추가하면 충분한 준비 시간을 확보할 수 있어요."
  ],
  "qrUrl": "www.koreaaitimes.com/books/n8n-vol2/recipe075"
}
← 이전 레시피☰ 목차다음 레시피 →