8
n8n 中文网amn8n.com

使用GPT-4o自动生成科研PDF的结构化摘要

中级

这是一个Document Extraction, AI Summarization领域的自动化工作流,包含 9 个节点。主要使用 Code, ConvertToFile, ReadWriteFile, Agent, ExtractFromFile 等节点。 使用GPT-4o生成结构化科研PDF摘要

前置要求
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "z1y59Ygza4dbq9vD",
  "meta": {
    "instanceId": "d92ae4b43988b888be9e59a711908a679453e558f86530d2ed2c1c3491f22bf5",
    "templateCredsSetupCompleted": true
  },
  "name": "使用GPT-4o自动生成科研PDF的结构化摘要",
  "tags": [],
  "nodes": [
    {
      "id": "cdf76194-f7e3-4846-8d8b-cd13a3a0404b",
      "name": "本地文件触发器",
      "type": "n8n-nodes-base.localFileTrigger",
      "position": [
        -160,
        0
      ],
      "parameters": {
        "events": [
          "add"
        ],
        "options": {},
        "triggerOn": "folder"
      },
      "typeVersion": 1
    },
    {
      "id": "d376462c-b09c-4d35-b631-5fb3ecc73ceb",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        600,
        160
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "hghRc8fMDt5M0xCj",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e759529e-fb21-4339-a981-a9cde3b9d63c",
      "name": "摘要生成器",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        640,
        0
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "=#Role \nYou are a research agent. You are very good at analyzing a research article and obtaining the best detail from it. You are a research expert who is providing data to another researcher. You are well versed in the scientific method. You will be provided data from a pdf {{ $json.text }}. You are to analyze this text and provide a thorough summary of it.\n\nProvide your summary in the format of:\nTitle\n\nIntroduction:\n-What is the importance of this study.\n-What are the specific aims of this study.\n-What questions are they trying to answer.\n-What studies have been done in the past in regards to this topic.\n\nMethods:\n-Go into detail about their methods.\n-What type of study is this.\n-How many subjects were included in the study.\n-How was their study designed.\n-What parameters or variables were they measuring. \n         -This is the most important part of this group. In the methods section of each paper they will define what the measurable outcomes of the study were. Sometimes they will have primary and secondary outcomes. You should include all of these.\n-What was their inclusion and exclusion criteria.\n\nResults:\n-This should be comprehensive.\n-It should give the results for every variable or measurable outcome tested.\n-specific numbers with statistical significance should be given.\n\nSummary:\n-You should provide the specific conclusions they came to from their results.\n-Provide how their results compare to other studies mentioned in their paper. In the summary section of the paper they often reference how their results compare to other studies. You should provide this in your summary.\n-Provide what their recommendations are based off the results.\n\nConclusion:\nProvide any weaknesses of the paper.\nProvide all examples of future studies they recommend be performed.\n\n\n\n#additional information\nIntroduction, methods, results, summary, and conclusion should all be new paragraphs. Your information should read smoothly and make sense. you can utilize bullet points or - if you would like for the individual points within the paragraphs. "
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "35c34c88-354b-4018-a66f-5cd2c3e8164a",
      "name": "转换器",
      "type": "n8n-nodes-base.code",
      "position": [
        40,
        0
      ],
      "parameters": {
        "jsCode": "return items.map(item => {\n  const originalPath = $input.first().json.path\n  const convertedPath = originalPath.replace(/\\\\/g, '/');\n  return {\n    json: {\n      ...item.json,\n      convertedPath\n    }\n  };\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "e357d953-e875-46f5-89a8-4c876c3bdd6e",
      "name": "PDF查找器",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        240,
        0
      ],
      "parameters": {
        "options": {},
        "fileSelector": "={{ $json.convertedPath }}"
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "1905ff88-d54a-4435-9ad1-7c1597da57cb",
      "name": "PDF提取器",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        440,
        0
      ],
      "parameters": {
        "options": {},
        "operation": "pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "48726ce0-5978-47f6-9688-7ff675128153",
      "name": "发布器",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1000,
        0
      ],
      "parameters": {
        "options": {},
        "operation": "toText",
        "sourceProperty": "output"
      },
      "typeVersion": 1.1
    },
    {
      "id": "5cc8a81d-3c55-4e8e-bb8c-1dd41e124ce1",
      "name": "保存到文件夹",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        1200,
        0
      ],
      "parameters": {
        "options": {},
        "operation": "write"
      },
      "typeVersion": 1
    },
    {
      "id": "be22bace-ec61-4494-8c88-8ef00b8624dd",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -840
      ],
      "parameters": {
        "color": 5,
        "width": 1320,
        "height": 820,
        "content": "右键点击并打开本地文件触发器。"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "c633a47e-bed2-42fc-a64f-fcb02cb6eae1",
  "connections": {
    "Converter": {
      "main": [
        [
          {
            "node": "PDF Finder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publisher": {
      "main": [
        [
          {
            "node": "Save to Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "PDF Finder": {
      "main": [
        [
          {
            "node": "PDF Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarizer": {
      "main": [
        [
          {
            "node": "Publisher",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "PDF Extractor": {
      "main": [
        [
          {
            "node": "Summarizer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Summarizer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Local File Trigger": {
      "main": [
        [
          {
            "node": "Converter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 文档提取, AI 摘要总结

需要付费吗?

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

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

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

作者
AiAgent

AiAgent

@lifehacks

As a self-taught entrepreneur, I’m passionate about automating everyday tasks to simplify life. Every system I create is designed to enhance efficiency and free up valuable time. Once I perfect an automation that transforms my own routine, I’m excited to share it with you—so you can experience the same benefits.

外部链接
在 n8n.io 查看

分享此工作流