8
n8n 한국어amn8n.com

발행서 생성

중급

이것은Finance, AI, IT Ops분야의자동화 워크플로우로, 12개의 노드를 포함합니다.주로 If, Set, Code, Webhook, EmailSend 등의 노드를 사용하며인공지능 기술을 결합하여 스마트 자동화를 구현합니다. 인보이스 생성, 클라우드 스토리지에 저장하고 JS+구글 스프레드시트를 사용하여 고객에게 이메일 발송

사전 요구사항
  • HTTP Webhook 엔드포인트(n8n이 자동으로 생성)
  • Google Drive API 인증 정보
  • 대상 API의 인증 정보가 필요할 수 있음
  • Google Sheets API 인증 정보
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "id": "K4XpJbwBJYnDiYkF",
  "meta": {
    "instanceId": "b3c467df4053d13fe31cc98f3c66fa1d16300ba750506bfd019a0913cec71ea3",
    "templateCredsSetupCompleted": true
  },
  "name": "Generate Invoices",
  "tags": [],
  "nodes": [
    {
      "id": "e56cbf88-1e0d-4dd7-a269-091ad2ce8420",
      "name": "Webhook 시뮬레이터",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -240,
        20
      ],
      "webhookId": "7f884a07-861e-49da-bb0e-1ac6ca40ea00",
      "parameters": {
        "path": "7f884a07-861e-49da-bb0e-1ac6ca40ea00",
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "b01307f7-b5cb-421e-833a-0889925bb09c",
      "name": "인보이스 ID 생성",
      "type": "n8n-nodes-base.code",
      "position": [
        -20,
        20
      ],
      "parameters": {
        "jsCode": "function generateOrderID(length = 6) {\n  const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n  let result = 'INV-';\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_id: generateOrderID()\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "bf50ca10-4021-4e6f-9c08-56fd84ce13ed",
      "name": "ID 존재 여부 확인",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        200,
        20
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $json.order_id }}",
              "lookupColumn": "Invoice ID"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QW_Lg1aoEBku8GaxwPbZfBY5ITAuSdvoAXRyNdCEujM/edit#gid=0",
          "cachedResultName": "Invoices"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1QW_Lg1aoEBku8GaxwPbZfBY5ITAuSdvoAXRyNdCEujM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QW_Lg1aoEBku8GaxwPbZfBY5ITAuSdvoAXRyNdCEujM/edit?usp=drivesdk",
          "cachedResultName": "Uppfy Shop Invoices"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "d0qeLhShx9sGXalR",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.5,
      "alwaysOutputData": true
    },
    {
      "id": "c63871fa-ca0f-4069-ac0d-422d39018a9e",
      "name": "존재하지 않는 경우",
      "type": "n8n-nodes-base.if",
      "position": [
        420,
        20
      ],
      "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": "feb9ed84-a62c-4cec-bf36-b53a76711bcd",
      "name": "필드 설정",
      "type": "n8n-nodes-base.set",
      "position": [
        740,
        -140
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1bd457b4-2c15-433a-96b3-5fabb8566866",
              "name": "order_id",
              "type": "string",
              "value": "={{ $('Generate Invoice ID').item.json.order_id }}"
            },
            {
              "id": "15c51334-b127-485e-9be4-051b086d74b2",
              "name": "customer_name",
              "type": "string",
              "value": "={{ $('Webhook Simulator').item.json.customer_name }}"
            },
            {
              "id": "8c4f2d5c-09c8-4b8c-a77f-ab3c1d752c13",
              "name": "customer_email",
              "type": "string",
              "value": "={{ $('Webhook Simulator').item.json.customer_email }}"
            },
            {
              "id": "ea1bbfe4-c12d-450f-9bee-fff8710eed42",
              "name": "products",
              "type": "array",
              "value": "={{ $('Webhook Simulator').item.json.products }}"
            },
            {
              "id": "025d0783-7eb0-4ac4-b373-39f744692cfd",
              "name": "total",
              "type": "number",
              "value": "={{ $('Webhook Simulator').item.json.total }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "0532fa4b-cdd9-4857-8701-6a5baf48fd7c",
      "name": "인보이스 HTML 생성",
      "type": "n8n-nodes-base.code",
      "position": [
        740,
        100
      ],
      "parameters": {
        "jsCode": "const { order_id, customer_name, customer_email, products, total } = $json;\n\n// Format products table rows\nconst productRows = products.map((item, index) => {\n  const subtotal = item.quantity * item.price;\n  return `\n    <tr>\n      <td style=\"padding: 8px; border: 1px solid #ccc;\">${index + 1}</td>\n      <td style=\"padding: 8px; border: 1px solid #ccc;\">${item.name}</td>\n      <td style=\"padding: 8px; border: 1px solid #ccc;\">${item.quantity}</td>\n      <td style=\"padding: 8px; border: 1px solid #ccc;\">$${item.price.toFixed(2)}</td>\n      <td style=\"padding: 8px; border: 1px solid #ccc;\">$${subtotal.toFixed(2)}</td>\n    </tr>\n  `;\n}).join('');\n\nconst html = `\n<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"UTF-8\">\n  <title>Invoice ${order_id}</title>\n</head>\n<body style=\"font-family: Arial, sans-serif; color: #333; max-width: 700px; margin: auto; padding: 20px; border: 1px solid #ddd;\">\n  <h2 style=\"text-align: center;\">Invoice</h2>\n  <p><strong>Order ID:</strong> ${order_id}</p>\n  <p><strong>Customer Name:</strong> ${customer_name}</p>\n  <p><strong>Email:</strong> ${customer_email}</p>\n\n  <table style=\"width: 100%; border-collapse: collapse; margin-top: 20px;\">\n    <thead>\n      <tr>\n        <th style=\"padding: 8px; border: 1px solid #ccc;\">#</th>\n        <th style=\"padding: 8px; border: 1px solid #ccc;\">Product</th>\n        <th style=\"padding: 8px; border: 1px solid #ccc;\">Qty</th>\n        <th style=\"padding: 8px; border: 1px solid #ccc;\">Unit Price</th>\n        <th style=\"padding: 8px; border: 1px solid #ccc;\">Subtotal</th>\n      </tr>\n    </thead>\n    <tbody>\n      ${productRows}\n    </tbody>\n    <tfoot>\n      <tr>\n        <td colspan=\"4\" style=\"text-align: right; padding: 8px; border: 1px solid #ccc;\"><strong>Total:</strong></td>\n        <td style=\"padding: 8px; border: 1px solid #ccc;\"><strong>$${total.toFixed(2)}</strong></td>\n      </tr>\n    </tfoot>\n  </table>\n\n  <p style=\"margin-top: 40px; text-align: center;\">Thank you for your order!</p>\n</body>\n</html>\n`;\n\nreturn [\n  {\n    json: {\n      html\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "5a3adb6a-9f64-477e-9622-3d2b9ef2e6de",
      "name": "HTML을 PDF로 변환",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -20,
        320
      ],
      "parameters": {
        "url": "https://html2pdf2.p.rapidapi.com/html2pdf",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "html",
              "value": "={{ $json.html }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "html2pdf2.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "\"your_rapid_api_key\""
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "cebf6d0d-d43f-4e50-abc0-79ff8da1817a",
      "name": "PDF를 GDrive에 업로드",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        420,
        320
      ],
      "parameters": {
        "name": "={{ $('Set Fields').item.json.order_id }} - {{ $('Set Fields').item.json.customer_name }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "l8Cc2MEVE7foBfbK",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "b181eddc-e786-4d44-a334-e1b581b3981f",
      "name": "고객에게 인보이스 이메일 발송",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        640,
        320
      ],
      "webhookId": "cdc852fc-03b9-4a89-ba56-879064da5cbb",
      "parameters": {
        "html": "=Hello  {{ $('Set Fields').item.json.customer_name }},\n\nPlease pay this invoice\n\n\n{{ $('Create Invoice HTML').item.json.html }}\n\n\n<!DOCTYPE html>\n<html>\n<head>\n    <style>\n        .button {\n            display: inline-block;\n            background-color: #4CAF50;\n            border: none;\n            border-radius: 4px;\n            color: white;\n            padding: 15px 32px;\n            text-align: center;\n            text-decoration: none;\n            font-size: 16px;\n            font-weight: bold;\n            margin: 4px 2px;\n            cursor: pointer;\n            font-family: Arial, sans-serif;\n        }\n    </style>\n</head>\n<body>\n    <div style=\"text-align: center;\">\n        <a href=\"YOUR_PAYMENT_LINK_HERE\" class=\"button\">Pay Now</a>\n    </div>\n</body>\n</html>\n\n",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ $('Set Fields').item.json.order_id }} - New Invoice from Uppfy Shop ",
        "toEmail": "={{ $('Set Fields').item.json.customer_email }}",
        "fromEmail": "Uppfy Shop <your_from_email>"
      },
      "credentials": {
        "smtp": {
          "id": "xcnAVXwtuOa1IOqE",
          "name": "SMTP account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "883e32b6-a812-44c8-b525-97e819af90bd",
      "name": "인보이스 시트에 세부 정보 추가",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        860,
        320
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "Unpaid",
            "Invoice ID": "={{ $('Set Fields').item.json.order_id }}",
            "Invoice URL": "={{ $('Upload PDF to GDrive').item.json.webViewLink }}",
            "Invoice Amt.": "=${{ $('Set Fields').item.json.total }}",
            "Customer Name": "={{ $('Set Fields').item.json.customer_name }}",
            "Customer Email": "={{ $('Set Fields').item.json.customer_email }}"
          },
          "schema": [
            {
              "id": "Invoice ID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Invoice ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Customer Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Customer Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Invoice Amt.",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Invoice Amt.",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Invoice URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Invoice URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Invoice ID"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QW_Lg1aoEBku8GaxwPbZfBY5ITAuSdvoAXRyNdCEujM/edit#gid=0",
          "cachedResultName": "Invoices"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1QW_Lg1aoEBku8GaxwPbZfBY5ITAuSdvoAXRyNdCEujM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QW_Lg1aoEBku8GaxwPbZfBY5ITAuSdvoAXRyNdCEujM/edit?usp=drivesdk",
          "cachedResultName": "Uppfy Shop Invoices"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "d0qeLhShx9sGXalR",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "cd06d6c9-903d-4af8-8327-eb36ba3bc73a",
      "name": "API에서 PDF 다운로드",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        200,
        320
      ],
      "parameters": {
        "url": " https://rhodium-tecnologia-html2pdf.s3.amazonaws.com/public/pdfs/1747392997249.pdf",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "7d308e22-9b2d-4993-8aad-cc701303d38d",
      "name": "스티커 메모",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -280,
        -160
      ],
      "parameters": {
        "width": 180,
        "height": 320,
        "content": "## Pinned Data to Simulate Webhook Query"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {
    "Webhook Simulator": [
      {
        "json": {
          "total": 65,
          "products": [
            {
              "name": "T-shirt",
              "price": 25,
              "quantity": 2
            },
            {
              "name": "Hat",
              "price": 15,
              "quantity": 1
            }
          ],
          "customer_name": "Jane Doe",
          "customer_email": "jane@example.com"
        }
      }
    ]
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "dec45f2b-cb36-4f86-a8cc-d3c498ae7aa2",
  "connections": {
    "feb9ed84-a62c-4cec-bf36-b53a76711bcd": {
      "main": [
        [
          {
            "node": "0532fa4b-cdd9-4857-8701-6a5baf48fd7c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5a3adb6a-9f64-477e-9622-3d2b9ef2e6de": {
      "main": [
        [
          {
            "node": "cd06d6c9-903d-4af8-8327-eb36ba3bc73a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c63871fa-ca0f-4069-ac0d-422d39018a9e": {
      "main": [
        [
          {
            "node": "feb9ed84-a62c-4cec-bf36-b53a76711bcd",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "b01307f7-b5cb-421e-833a-0889925bb09c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e56cbf88-1e0d-4dd7-a269-091ad2ce8420": {
      "main": [
        [
          {
            "node": "b01307f7-b5cb-421e-833a-0889925bb09c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0532fa4b-cdd9-4857-8701-6a5baf48fd7c": {
      "main": [
        [
          {
            "node": "5a3adb6a-9f64-477e-9622-3d2b9ef2e6de",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b01307f7-b5cb-421e-833a-0889925bb09c": {
      "main": [
        [
          {
            "node": "bf50ca10-4021-4e6f-9c08-56fd84ce13ed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cebf6d0d-d43f-4e50-abc0-79ff8da1817a": {
      "main": [
        [
          {
            "node": "b181eddc-e786-4d44-a334-e1b581b3981f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cd06d6c9-903d-4af8-8327-eb36ba3bc73a": {
      "main": [
        [
          {
            "node": "cebf6d0d-d43f-4e50-abc0-79ff8da1817a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b181eddc-e786-4d44-a334-e1b581b3981f": {
      "main": [
        [
          {
            "node": "883e32b6-a812-44c8-b525-97e819af90bd",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "bf50ca10-4021-4e6f-9c08-56fd84ce13ed": {
      "main": [
        [
          {
            "node": "c63871fa-ca0f-4069-ac0d-422d39018a9e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

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

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

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

중급 - 금융, 인공지능, IT 운영

유료인가요?

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

워크플로우 정보
난이도
중급
노드 수12
카테고리3
노드 유형9
난이도 설명

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

저자
Joseph

Joseph

@mjomba

Automation expert specializing in building smart, scalable workflows using tools like n8n, Make, and Airtable. I help businesses save time, reduce manual work, and grow faster with tailored automation solutions. Feel free to reach out at joseph@uppfy.com to discuss your project. I am also on x.com/juppfy

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34