Stripe、Google Drive、Google Sheetsを使用した支払い領収書のアーカイブ

上級

これはContent Creation, Multimodal AI分野の自動化ワークフローで、21個のノードを含みます。主にIf, Gmail, SplitOut, GoogleDrive, HttpRequestなどのノードを使用。 支払い確実書の自動化:StripeとGoogle Workspaceを使用したメール送信、書類保存、追跡

前提条件
  • Googleアカウント + Gmail API認証情報
  • Google Drive API認証情報
  • ターゲットAPIの認証情報が必要な場合あり
  • Google Sheets API認証情報
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "id": "gr2rafzxOw1ks4Bd",
  "meta": {
    "instanceId": "8443f10082278c46aa5cf3acf8ff0f70061a2c58bce76efac814b16290845177",
    "templateCredsSetupCompleted": true
  },
  "name": "Archive Payment Receipts with Stripe, Google Drive, and Google Sheets",
  "tags": [],
  "nodes": [
    {
      "id": "cdfad755-0724-4156-b4ec-04a671a85013",
      "name": "ワークフロー実行時",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1104,
        -32
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a511f05a-495d-4066-af54-9b977ca59aec",
      "name": "請求書を取得",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -848,
        -32
      ],
      "parameters": {
        "url": "https://api.stripe.com/v1/invoices?limit=5",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer ${{credential.stripe.secret.key}}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c24bc890-1e3e-4334-88a2-69fcd2c0be5e",
      "name": "付箋",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -928,
        128
      ],
      "parameters": {
        "height": 272,
        "content": "Fetch Invoices\n\nDescription: Makes an authenticated request to the Stripe API and retrieves the 5 most recent invoices. This serves as the raw dataset that contains invoice details such as customer information, amounts, statuses, and hosted invoice URLs.\nAction: Fetches invoice data from Stripe."
      },
      "typeVersion": 1
    },
    {
      "id": "1d8ec260-aa38-4dfa-8f73-98ea5e5e671c",
      "name": "付箋1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        -544
      ],
      "parameters": {
        "height": 288,
        "content": "Send Receipt Email – \n\nDescription: Sends an email to the customer using the invoice details (customer name, invoice number, amount, etc.). The previously downloaded invoice PDF is attached automatically. This ensures the customer receives a formal receipt directly in their inbox.\nAction: Sends a payment receipt email with the PDF attached."
      },
      "typeVersion": 1
    },
    {
      "id": "94dac976-2243-463c-8ac0-5bf2b3061a95",
      "name": "付箋2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        80
      ],
      "parameters": {
        "height": 240,
        "content": "Download File \n\nDescription: Uses the invoice’s hosted PDF link (invoice_pdf) to fetch the actual receipt document. It retrieves the PDF from Stripe as binary data, making it usable as an email attachment or for archiving.\nAction: Downloads the invoice PDF from Stripe."
      },
      "typeVersion": 1
    },
    {
      "id": "afba0c2a-08e2-4d19-ab7f-29e79b70c29a",
      "name": "付箋3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        -352
      ],
      "parameters": {
        "height": 256,
        "content": "IF (Already Receipted?) \n\nDescription: Looks into the invoice metadata field receipt_sent. If the receipt has already been generated and sent, the workflow will skip. Otherwise, it continues to generate and send the receipt email.\nAction: Filters out invoices that already have a receipt sent."
      },
      "typeVersion": 1
    },
    {
      "id": "64a4d0dc-6d8f-4728-adaf-ce509afce060",
      "name": "付箋4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        96
      ],
      "parameters": {
        "height": 224,
        "content": "IF (Paid?)\n\nDescription: Evaluates whether the invoice is marked as status = paid. Only paid invoices should move forward to receipt generation. Unpaid or draft invoices are skipped here.\nAction: Routes invoices based on payment status."
      },
      "typeVersion": 1
    },
    {
      "id": "d776ef15-e417-4449-a2a5-e1c53319f87e",
      "name": "付箋5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -368
      ],
      "parameters": {
        "height": 288,
        "content": "Expand List\n\nDescription: Since Stripe returns a bundled list of invoices, this node breaks them into individual records. That way, each invoice can be independently evaluated (paid/unpaid, receipted/unreceipted) and processed correctly in subsequent steps.\nAction: Splits Stripe’s invoice list into single invoice items."
      },
      "typeVersion": 1
    },
    {
      "id": "8c3f5034-5e26-429d-9d30-4f56dd99db5d",
      "name": "付箋6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        288
      ],
      "parameters": {
        "height": 288,
        "content": "Append to Ledger \n\nDescription: Adds a new row in the “Payment Receipts” Google Sheet ledger with key invoice details such as date, invoice number, file name, Drive link, file ID, and file size. This acts as your permanent record of receipts for accounting and tracking purposes.\nAction: Updates the Google Sheet with invoice + Drive file metadata."
      },
      "typeVersion": 1
    },
    {
      "id": "aacfb7d2-7acb-4b1a-a7c7-39069a01055f",
      "name": "付箋7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        272
      ],
      "parameters": {
        "height": 208,
        "content": "Upload Invoice PDF \n\nDescription: Uploads the invoice PDF into a specific Google Drive folder. The file is named according to the invoice number, making it easy to search and retrieve later.\nAction: Stores the invoice PDF in Google Drive."
      },
      "typeVersion": 1
    },
    {
      "id": "b107aa2b-90b9-48fe-98dc-d828012444e7",
      "name": "リストを展開",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -336,
        -48
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "=data"
      },
      "typeVersion": 1
    },
    {
      "id": "a83ac85d-4737-44bc-877e-6844389a9689",
      "name": "IF (支払済み?)",
      "type": "n8n-nodes-base.if",
      "position": [
        -128,
        -48
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "3e81fec9-095e-4ada-b6d0-1e7db2d0b446",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "paid"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d7fec273-c100-43bf-9ddc-311f31b34493",
      "name": "IF (領収書発行済み?)",
      "type": "n8n-nodes-base.if",
      "position": [
        128,
        -64
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "b8f92661-228b-457c-b6ae-263ba3b034da",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.metadata.receipt_sent }}",
              "rightValue": "false"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "c2dbb175-469f-4c19-8466-08afba27115d",
      "name": "ファイルをダウンロード",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        464,
        -80
      ],
      "parameters": {
        "url": "={{$json[\"invoice_pdf\"]}}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "49c0e75c-8b77-4d43-bc71-60b6bd02519a",
      "name": "領収書メールを送信",
      "type": "n8n-nodes-base.gmail",
      "position": [
        736,
        -240
      ],
      "webhookId": "0c82c299-6938-42ed-bda6-5007d79af34f",
      "parameters": {
        "sendTo": "={{$json.customer_email}}",
        "message": "=Hi {{$json.customer_name}},  \n\nThanks for your payment.  \nAttached is your receipt for invoice {{$json.number}} (Total: {{$json.currency}} {{$json.total}}).  \n\nRegards,  \nYour Company\n",
        "options": {
          "attachmentsUi": {
            "attachmentsBinary": [
              {}
            ]
          }
        },
        "subject": "=Payment Receipt - Invoice {{$json.number}}",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "RchiXdmY8WaQhOSJ",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "b4401084-8c70-47f3-8804-637c9bef9834",
      "name": "請求書PDFをアップロード",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        768,
        112
      ],
      "parameters": {
        "name": "={{$json[\"number\"]}}.pdf",
        "driveId": {
          "__rl": true,
          "mode": "url",
          "value": "{{YOUR_GOOGLE_DRIVE_URL}}"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "url",
          "value": "{{YOUR_URL}}"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "E7nEqUL27GUx1xHa",
          "name": "Techdome Account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "1efedacb-1e07-4e23-ab7c-19e0e21b6b08",
      "name": "台帳に追加",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1040,
        112
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "url",
          "value": "{{YOUR_URL}}"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "{{YOUR_SPREADSHEET_URL}}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "kpPEOLCGn963qpoh",
          "name": "automations@techdome.ai"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "f535062a-1ced-46d3-8b4e-73aaeb6c6e3b",
      "name": "エラーログ記録",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -384,
        272
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "url",
          "value": "{{YOUR_URL}}"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "{{YOUR_SPREADSHEET_URL}}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "kpPEOLCGn963qpoh",
          "name": "automations@techdome.ai"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "6f14b401-170b-4fb8-ae5d-aa079f7549cb",
      "name": "付箋8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -464,
        432
      ],
      "parameters": {
        "height": 320,
        "content": "Action: Logs workflow errors and failures to a dedicated error tracking spreadsheet for monitoring and debugging purposes. \n\nDescription: This Google Sheets append node serves as the error logging destination for your workflow's error handling system. When API calls fail, data validation errors occur, or other workflow issues arise, this node captures the error details and appends them as new rows to your \"error log sheet\"."
      },
      "typeVersion": 1
    },
    {
      "id": "4cd976cd-8739-47ad-bddd-25d0973c3cd8",
      "name": "APIレスポンスを確認",
      "type": "n8n-nodes-base.if",
      "position": [
        -608,
        -32
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "e2130860-3ee5-490c-9eb0-6a6e02e9f41e",
              "operator": {
                "type": "array",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.data }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "89781301-0ca4-4dc7-924f-0ea978d6bc83",
      "name": "付箋9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        -400
      ],
      "parameters": {
        "height": 336,
        "content": "Action: Validates that the Stripe API returned a proper data array before attempting to process invoices. \n\nDescription: This conditional node acts as a data quality gate that prevents the workflow from breaking when the Stripe API returns unexpected or empty responses. It specifically checks for the existence of the data array in the API response, which is the standard structure that Stripe uses to return collections of objects like invoices, payments, or disputes."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d54ecc14-b03b-46b3-88c8-1b25d10351db",
  "connections": {
    "a83ac85d-4737-44bc-877e-6844389a9689": {
      "main": [
        [
          {
            "node": "d7fec273-c100-43bf-9ddc-311f31b34493",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b107aa2b-90b9-48fe-98dc-d828012444e7": {
      "main": [
        [
          {
            "node": "a83ac85d-4737-44bc-877e-6844389a9689",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c2dbb175-469f-4c19-8466-08afba27115d": {
      "main": [
        [
          {
            "node": "49c0e75c-8b77-4d43-bc71-60b6bd02519a",
            "type": "main",
            "index": 0
          },
          {
            "node": "b4401084-8c70-47f3-8804-637c9bef9834",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a511f05a-495d-4066-af54-9b977ca59aec": {
      "main": [
        [
          {
            "node": "4cd976cd-8739-47ad-bddd-25d0973c3cd8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4cd976cd-8739-47ad-bddd-25d0973c3cd8": {
      "main": [
        [
          {
            "node": "b107aa2b-90b9-48fe-98dc-d828012444e7",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "f535062a-1ced-46d3-8b4e-73aaeb6c6e3b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "49c0e75c-8b77-4d43-bc71-60b6bd02519a": {
      "main": [
        []
      ]
    },
    "b4401084-8c70-47f3-8804-637c9bef9834": {
      "main": [
        [
          {
            "node": "1efedacb-1e07-4e23-ab7c-19e0e21b6b08",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d7fec273-c100-43bf-9ddc-311f31b34493": {
      "main": [
        [
          {
            "node": "c2dbb175-469f-4c19-8466-08afba27115d",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "cdfad755-0724-4156-b4ec-04a671a85013": {
      "main": [
        [
          {
            "node": "a511f05a-495d-4066-af54-9b977ca59aec",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

上級 - コンテンツ作成, マルチモーダルAI

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

ワークフロー情報
難易度
上級
ノード数21
カテゴリー2
ノードタイプ8
難易度説明

上級者向け、16ノード以上の複雑なワークフロー

作成者
Rahul Joshi

Rahul Joshi

@rahul08

Rahul Joshi is a seasoned technology leader specializing in the n8n automation tool and AI-driven workflow automation. With deep expertise in building open-source workflow automation and self-hosted automation platforms, he helps organizations eliminate manual processes through intelligent n8n ai agent automation solutions.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34