8
n8n 中文网amn8n.com

合并PDF1

中级

这是一个IT Ops领域的自动化工作流,包含 7 个节点。主要使用 Merge, HttpRequest, ManualTrigger, ReadWriteFile, MergePdfs 等节点。 使用CustomJS API合并多个PDF文件

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

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "MVPlLz3CiQok6rXy",
  "meta": {
    "instanceId": "7599ed929ea25767a019b87ecbc83b90e16a268cb51892887b450656ac4518a2",
    "templateCredsSetupCompleted": true
  },
  "name": "合并PDF1",
  "tags": [],
  "nodes": [
    {
      "id": "282b146b-ee58-4089-9ee6-94b153024bfa",
      "name": "当点击\"测试工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        740,
        -40
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "39a37abd-924f-474c-8dde-7536170797f2",
      "name": "HTTP 请求",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        960,
        -140
      ],
      "parameters": {
        "url": "=https://www.intewa.com/fileadmin/documents/pdf-file.pdf",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "b2359766-896f-4966-873e-b2dc0ee4f684",
      "name": "HTTP请求2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        960,
        60
      ],
      "parameters": {
        "url": "=https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "7f70b25c-a171-4a7c-8067-141ce3275226",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        1180,
        -40
      ],
      "parameters": {},
      "typeVersion": 3.1
    },
    {
      "id": "183b90b4-5f22-4ff8-b47f-96b7c4d522d7",
      "name": "从磁盘读取/写入文件4",
      "type": "@custom-js/n8n-nodes-pdf-toolkit.mergePdfs",
      "position": [
        1400,
        -40
      ],
      "parameters": {},
      "credentials": {
        "customJsApi": {
          "id": "h29wo2anYKdANAzm",
          "name": "CustomJS account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "131474f2-c6ca-4d1f-ba49-1f2f6d91394a",
      "name": "从磁盘读取/写入文件",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        1620,
        -40
      ],
      "parameters": {
        "options": {},
        "fileName": "test.pdf",
        "operation": "write"
      },
      "typeVersion": 1
    },
    {
      "id": "a86ddc41-60aa-482c-90f2-8eacc6bb0a9b",
      "name": "触发器启动",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        1840,
        -40
      ],
      "parameters": {
        "options": {},
        "fileSelector": "test.pdf"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "02f73022-a678-4660-ab1d-3531e4848cba",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Merge PDF1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge PDF1": {
      "main": [
        [
          {
            "node": "Read/Write Files from Disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request2": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Read/Write Files from Disk": {
      "main": [
        [
          {
            "node": "Read/Write Files from Disk4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          },
          {
            "node": "HTTP Request2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - IT 运维

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流