8
n8n 中文网amn8n.com

将SmartBill的PDF发票导出到Google Drive

中级

这是一个Finance领域的自动化工作流,包含 15 个节点。主要使用 If, Set, Code, Wait, GoogleDrive 等节点。 将SmartBill的PDF发票导出到Google Drive

前置要求
  • Google Drive API 凭证
  • 可能需要目标 API 的认证凭证

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "e122e4b90b0dc212c47b42e306cb84c993d082784105d7fe578eca9a9d068de0",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "119111b6-92a8-4a54-8830-2a12a0d4eec8",
      "name": "当点击\"执行工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -580,
        -60
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "bf0767db-8dd2-4f83-a27f-37c1160916d4",
      "name": "Smartbill获取发票PDF",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1640,
        -60
      ],
      "parameters": {},
      "typeVersion": 4.1
    },
    {
      "id": "f8bd05d5-0d7e-4db8-9f07-070e4d48af3b",
      "name": "设置数据",
      "type": "n8n-nodes-base.set",
      "position": [
        -300,
        -60
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "57999d68-71d4-4d3c-968a-50c1f20cb010",
      "name": "设置MIME类型",
      "type": "n8n-nodes-base.code",
      "position": [
        1900,
        -60
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "61771345-4562-4c4b-b00d-db8fb0b80f1e",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -180
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d3d8feb2-cda6-4c78-b96c-7c8938b23bb7",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -520
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ee617dbb-effb-4671-b23b-152058edd76f",
      "name": "设置默认文件夹名称",
      "type": "n8n-nodes-base.code",
      "position": [
        -20,
        -60
      ],
      "parameters": {},
      "notesInFlow": false,
      "typeVersion": 2
    },
    {
      "id": "15da1268-7ea0-444a-ac79-3d6ec0057b80",
      "name": "搜索云端硬盘文件夹",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        200,
        -60
      ],
      "parameters": {},
      "typeVersion": 3,
      "alwaysOutputData": true
    },
    {
      "id": "d63071eb-ca34-4eb7-8da1-5c8172f4f7fe",
      "name": "如果存在",
      "type": "n8n-nodes-base.if",
      "position": [
        420,
        -60
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "7cec08c1-737e-4178-92ea-11914821e2ef",
      "name": "创建云端硬盘文件夹",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        680,
        80
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "78532c10-0c70-4c8c-9b93-bdcb3e80dbce",
      "name": "设置循环",
      "type": "n8n-nodes-base.code",
      "position": [
        1160,
        -60
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "93bc581c-0624-4fdd-ba06-e0ff3836ea53",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1380,
        -60
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "40d272e8-458f-4946-916e-4eaf9960d4f0",
      "name": "上传文件到Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2140,
        -60
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "08d5a34a-3e6c-4bfd-bc3e-0cbfedf9d715",
      "name": "等待一秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        2380,
        -40
      ],
      "webhookId": "fc3f4340-3fc1-4b8a-9f3d-41dccbfb8347",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "a1dca3c1-b9ce-443b-b942-908ab10c1610",
      "name": "设置文件夹ID",
      "type": "n8n-nodes-base.set",
      "position": [
        920,
        -60
      ],
      "parameters": {},
      "typeVersion": 3.4
    }
  ],
  "pinData": {},
  "connections": {
    "SetData": {
      "main": [
        [
          {
            "node": "Set Default Folder Name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set mime": {
      "main": [
        [
          {
            "node": "Upload file to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If exists": {
      "main": [
        [
          {
            "node": "Set Folder ID",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create Drive Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait a sec": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set the loop": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Folder ID": {
      "main": [
        [
          {
            "node": "Set the loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Smartbill get invoice pdf",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Drive Folder": {
      "main": [
        [
          {
            "node": "Set Folder ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Drive Folder": {
      "main": [
        [
          {
            "node": "If exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Default Folder Name": {
      "main": [
        [
          {
            "node": "Search Drive Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Smartbill get invoice pdf": {
      "main": [
        [
          {
            "node": "Set mime",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file to Google Drive": {
      "main": [
        [
          {
            "node": "Wait a sec",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \"Execute Workflow\"": {
      "main": [
        [
          {
            "node": "SetData",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 财务

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量15
分类1
节点类型9
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Codez

Codez

@codez

Building automations and AI agents for businesses

外部链接
在 n8n.io 查看

分享此工作流