8
n8n 한국어amn8n.com

PDF 제너레이터 API와 구글 서비스를 사용하여 발행, 암호화 및 전송

중급

이것은Invoice Processing분야의자동화 워크플로우로, 13개의 노드를 포함합니다.주로 If, Code, Gmail, Webhook, GoogleDrive 등의 노드를 사용하며. PDF 제너레이터 API와 구글 서비스(Sheets/Drive/Gmail)를 사용한 발행, 암호화 및 전송

사전 요구사항
  • Google 계정 및 Gmail API 인증 정보
  • HTTP Webhook 엔드포인트(n8n이 자동으로 생성)
  • Google Drive API 인증 정보
  • Google Sheets API 인증 정보

카테고리

워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "id": "NmF3SAX03cSvsHpW",
  "meta": {
    "instanceId": "82c5bea520362e516241165c0caf720c8d29d2f0ba5e3cae2ba36d2c25d3b3b3",
    "templateCredsSetupCompleted": true
  },
  "name": "Generate, Encrypt, and Send Invoices with PDF Generator API & Google Suite",
  "tags": [],
  "nodes": [
    {
      "id": "e30f9a26-b270-41ea-b732-95df22a8b3ed",
      "name": "송장 ID 생성",
      "type": "n8n-nodes-base.code",
      "position": [
        480,
        208
      ],
      "parameters": {
        "jsCode": "function generateOrderNumber(length = 8) {\n  const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n  let result = 'INVOICE-';\n  for (let i = 0; i < length; i++) {\n    result += chars.charAt(Math.floor(Math.random() * chars.length));\n  }\n  return result;\n}\n\nreturn [\n  {\n    json: {\n      order_number: generateOrderNumber()\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "5fb09b61-d55e-4b78-bdd8-cfc997737434",
      "name": "ID 존재 여부 확인",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        688,
        208
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1915774434,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WO-vIxG5lSWWF7_BwDDjLSfEbwNkFtIcMSgFRKAoUCU/edit#gid=1915774434",
          "cachedResultName": "Sheet2"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1WO-vIxG5lSWWF7_BwDDjLSfEbwNkFtIcMSgFRKAoUCU",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WO-vIxG5lSWWF7_BwDDjLSfEbwNkFtIcMSgFRKAoUCU/edit?usp=drivesdk",
          "cachedResultName": "n8n pokus x"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "08Gu0Eo5Pzygwy0U",
          "name": "Google Sheets account 2"
        }
      },
      "typeVersion": 4.5,
      "alwaysOutputData": true
    },
    {
      "id": "7a7132cf-2847-4dc6-812c-036339b6d30d",
      "name": "존재하지 않는 경우",
      "type": "n8n-nodes-base.if",
      "position": [
        912,
        208
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "cee7659a-cea3-494a-b4f3-c76d035a3a32",
              "operator": {
                "type": "string",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json.row_number }}",
              "rightValue": ""
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "23696cc6-71e0-4a5f-a391-5116024ad19d",
      "name": "메모",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        0
      ],
      "parameters": {
        "color": 3,
        "height": 352,
        "content": "## Pinned TEST data \nThis pinned data simulates the test payload (JSON) from the Webhook. It contains sample customer and line item details needed to test the invoice generation."
      },
      "typeVersion": 1
    },
    {
      "id": "32b3abc7-9cc3-4586-8bc2-10234c1071f2",
      "name": "메모1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        128
      ],
      "parameters": {
        "width": 656,
        "height": 288,
        "content": "## Generate a random INVOICE number and check for duplicities"
      },
      "typeVersion": 1
    },
    {
      "id": "d0c8d1a6-02df-4038-af24-ee607f67a1ae",
      "name": "메모2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1152,
        16
      ],
      "parameters": {
        "color": 5,
        "width": 224,
        "height": 528,
        "content": "## Generate a document and Encrypt"
      },
      "typeVersion": 1
    },
    {
      "id": "1d61d3f5-251f-43b2-9d75-e916fc04c2ca",
      "name": "메모3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        448
      ],
      "parameters": {
        "color": 4,
        "width": 624,
        "height": 272,
        "content": "## Upload the file and send the invoice to the customer"
      },
      "typeVersion": 1
    },
    {
      "id": "e6b468a5-abc2-4a81-b7ec-a1fc133b7cfa",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        192,
        208
      ],
      "webhookId": "4707540d-382e-45b2-a385-4ee35b447c27",
      "parameters": {
        "path": "4707540d-382e-45b2-a385-4ee35b447c27",
        "options": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "c4a87e74-50e3-4e67-a313-9503502987e7",
      "name": "PDF 문서 생성",
      "type": "@pdfgeneratorapi/n8n-nodes-pdf-generator-api.pdfGeneratorApi",
      "position": [
        1216,
        128
      ],
      "parameters": {
        "data": "={\n  \"order_number\": \"{{ $('Generate Invoice ID').item.json.order_number }}\",\n  \"name\": \"{{ $('Webhook').item.json.name }}\",\n  \"company\": \"{{ $('Webhook').item.json.company }}\",\n  \"address1\": \"{{ $('Webhook').item.json.address1 }}\",\n  \"city\": \"{{ $('Webhook').item.json.city }}\",\n  \"additional_fee\": \"{{ $('Webhook').item.json.additional_fee }}\",\n  \"payment_qr_data\": \"{{ $('Webhook').item.json.payment_qr_data }}\",\n  \"line_items\": {{ $('Webhook').item.json.line_items.toJsonString() }}\n}",
        "templateId": {
          "__rl": true,
          "mode": "list",
          "value": "496040",
          "cachedResultName": "n8n Invoice Example (ID: 496040)"
        },
        "documentOutput": "url",
        "additionalFields": {}
      },
      "credentials": {
        "pdfGeneratorApi": {
          "id": "pSQlBnNFYD88fvp9",
          "name": "PDF Generator account 2"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "44d10eb3-8b32-465d-8482-2bcd0791dd26",
      "name": "메모4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        -224
      ],
      "parameters": {
        "color": 5,
        "width": 464,
        "height": 224,
        "content": "## PDF Generator API\nThe PDF Generator API node connects to the pdfgeneratorapi.com service. In this workflow, it dynamically generates a PDF document (like an invoice) by populating a custom document template—which can be downloaded from this workflow's description—using data passed from earlier steps. After generation, it uses a separate 'pdfServices' operation to encrypt the PDF with a password, ensuring the file is secure before it's sent to the customer."
      },
      "typeVersion": 1
    },
    {
      "id": "afa73496-801f-4ad4-a412-045466d88175",
      "name": "파일 업로드",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        496,
        560
      ],
      "parameters": {
        "name": "={{ $('Generate Invoice ID').item.json.order_number }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultUrl": "https://drive.google.com/drive/my-drive",
          "cachedResultName": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "16TmHxVNxPHVoXZX5_an_dPAeFCx_eGKb",
          "cachedResultUrl": "https://drive.google.com/drive/folders/16TmHxVNxPHVoXZX5_an_dPAeFCx_eGKb",
          "cachedResultName": "n8n_folder"
        },
        "inputDataFieldName": "={{ $json.filename }}"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "Kp4HGmhvE2GijDkO",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "52a1e363-9295-4772-bdce-bbbe4027ebb9",
      "name": "메시지 + 파일 전송",
      "type": "n8n-nodes-base.gmail",
      "position": [
        736,
        560
      ],
      "webhookId": "c45e05bd-18c5-4b7d-963a-f5eccfdccaef",
      "parameters": {
        "sendTo": "={{ $('Webhook').item.json.email }}",
        "message": "=Dear {{ $('Webhook').item.json.name}},\n\nPlease find your invoice ({{ $('Generate Invoice ID').item.json.order_number }}) attached.\n\nThe document is encrypted with your customer_id as a password.\n\nPayment details are included on the invoice. Please don't hesitate to reach out if you have any questions.\n\nWe appreciate your business.\n\nBest regards,",
        "options": {
          "attachmentsUi": {
            "attachmentsBinary": [
              {
                "property": "={{ $('Encrypt PDF document').item.json.filename }}"
              }
            ]
          }
        },
        "subject": "=Here's your {{ $('Generate Invoice ID').item.json.order_number }}",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "oEDSqYf3kAYs7F15",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1,
      "alwaysOutputData": false
    },
    {
      "id": "2093fdde-1ea0-4237-8bba-d52c014b50b3",
      "name": "PDF 문서 암호화",
      "type": "@pdfgeneratorapi/n8n-nodes-pdf-generator-api.pdfGeneratorApi",
      "position": [
        1216,
        352
      ],
      "parameters": {
        "fileUrl": "={{ $json.response }}",
        "resource": "pdfServices",
        "operation": "encrypt",
        "outputFormat": "file",
        "ownerPassword": "={{ $('Webhook').item.json.customer_id }}"
      },
      "credentials": {
        "pdfGeneratorApi": {
          "id": "pSQlBnNFYD88fvp9",
          "name": "PDF Generator account 2"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {
    "Webhook": [
      {
        "json": {
          "city": "San Francisco, CA 94105",
          "date": "2025-10-29",
          "name": "Alex Johnson",
          "email": "example@email.com",
          "company": "Tech Solutions LLC",
          "address1": "456 Market St",
          "line_items": [
            {
              "fee": 85,
              "note": "Includes 3 rounds of revisions",
              "hours": 10,
              "description": "Website Design Mockups"
            },
            {
              "fee": 110,
              "note": "React components for homepage",
              "hours": 15,
              "description": "Frontend Development"
            },
            {
              "fee": 70,
              "note": "Weekly check-ins and coordination",
              "hours": 4,
              "description": "Project Management"
            }
          ],
          "customer_id": "12345",
          "additional_fee": 50,
          "payment_qr_data": "https://www.example.com/pay?invoice=2025-0042"
        }
      }
    ]
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "1bf2294e-f7ea-4df1-b167-087052a7d957",
  "connections": {
    "e6b468a5-abc2-4a81-b7ec-a1fc133b7cfa": {
      "main": [
        [
          {
            "node": "e30f9a26-b270-41ea-b732-95df22a8b3ed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "afa73496-801f-4ad4-a412-045466d88175": {
      "main": [
        [
          {
            "node": "52a1e363-9295-4772-bdce-bbbe4027ebb9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7a7132cf-2847-4dc6-812c-036339b6d30d": {
      "main": [
        [
          {
            "node": "c4a87e74-50e3-4e67-a313-9503502987e7",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "e30f9a26-b270-41ea-b732-95df22a8b3ed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e30f9a26-b270-41ea-b732-95df22a8b3ed": {
      "main": [
        [
          {
            "node": "5fb09b61-d55e-4b78-bdd8-cfc997737434",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2093fdde-1ea0-4237-8bba-d52c014b50b3": {
      "main": [
        [
          {
            "node": "afa73496-801f-4ad4-a412-045466d88175",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c4a87e74-50e3-4e67-a313-9503502987e7": {
      "main": [
        [
          {
            "node": "2093fdde-1ea0-4237-8bba-d52c014b50b3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5fb09b61-d55e-4b78-bdd8-cfc997737434": {
      "main": [
        [
          {
            "node": "7a7132cf-2847-4dc6-812c-036339b6d30d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

이 워크플로우를 어떻게 사용하나요?

위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.

이 워크플로우는 어떤 시나리오에 적합한가요?

중급 - 청구서 처리

유료인가요?

이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
중급
노드 수13
카테고리1
노드 유형8
난이도 설명

일정 경험을 가진 사용자를 위한 6-15개 노드의 중간 복잡도 워크플로우

저자
Marián Današ

Marián Današ

@marian

Hi, I'm Marian Danas. With several years of experience at pdfgeneratorapi.com, my focus has been on robust document automation. I've recently discovered a new passion for n8n, which I believe is key to expanding our business by integrating powerful PDF generation into any automated process. I'm here to build and share workflows that connect these two worlds.

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34