8
n8n 中文网amn8n.com

使用Lookio和OpenAI GPT从知识源创建基于事实的文章

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 19 个节点。主要使用 Set, SplitOut, Aggregate, FormTrigger, HttpRequest 等节点。 使用Lookio和OpenAI GPT从知识源创建基于事实的文章

前置要求
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "nodes": [
    {
      "id": "92d1a6cf-5c1b-44e2-a6b7-7b51b5e8455e",
      "name": "新内容 - 生成研究问题",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -1008,
        528
      ],
      "parameters": {
        "text": "=Content title:  {{ $json.Title }}\n\nArticle guidelines: {{ $json.Guidelines }}\n\n",
        "messages": {
          "messageValues": [
            {
              "message": "=You will receive a content title and an angle. Return 5–8 non-overlapping questions in JSON array format that cover everything needed to write excellent content as it breaks down the topic into sub-questions.\n\nGuidelines:  \n- Start with simple, short broad questions for example to define the terms (e.g., What is X?, Why is X important?, How to do X?).  \n- Then move into more specific, advanced, or analytical questions.  \n- Ensure questions together form a complete coverage of the topic.   \n\n## Output format:\n\nYou'll return the questions in such a JSON ARRAY:\n\n[\n  {\n    \"question\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit?\"\n  },\n  {\n    \"question\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua?\"\n  },\n  {\n    \"question\": \"Lorem ipsum dolor sit amet?\"\n  },\n  {\n    \"question\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua, ut enim ad minim veniam?\"\n  },\n  {\n    \"question\": \"Lorem ipsum dolor sit amet, consectetur?\"\n  }\n]"
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.5
    },
    {
      "id": "a83ee6c4-b669-4985-a905-00c1246d4e90",
      "name": "格式化问题与答案",
      "type": "n8n-nodes-base.set",
      "position": [
        320,
        768
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1e33a1f4-a1a2-4962-ac72-cc518d7ff043",
              "name": "Question",
              "type": "string",
              "value": "={{ $('Loop Over Questions').item.json.question }}"
            },
            {
              "id": "903bcf38-13dd-48fb-8eb3-83f7a232aa53",
              "name": "Answer",
              "type": "string",
              "value": "={{ $json.Output }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "012b019b-be98-416a-a2ba-457adbd1d81a",
      "name": "新内容 - 生成 AI 输出",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        144,
        -48
      ],
      "parameters": {
        "text": "=Article title:\n\n{{ $('Prepare form values').first().json.Title }}\n\nArticle guidelines:\n\n{{ $('Prepare form values').first().json.Guidelines }}\n\n\nContent to leverage:\n\nThis Q&A research provides high-quality knowledge, insights, and sources for your content. Be sure to include source links in your output whenever a source was used.\n\n{{ JSON.stringify($json['Content to leverage'], null, 2) }}\n",
        "messages": {
          "messageValues": [
            {
              "message": "=# Role\n\nYour role is to write an article based on the request in the user message.\n\n# What the user message contains\n\nThe user message includes the article title, any guidelines to follow, and comprehensive research material. This research is the sole basis for your article — do not invent information beyond it. When the research includes source links, integrate them smoothly as hyperlinks in the article.\n\n# How to write good articles\n\nYou excel at writing articles by making sure that they deliver value, are concise, seem like they are human-written, not using typical AI useless sentence formulations.\n\n# Your output format\n\nOutput only the full article.\n\n* Begin with a `# H1` title.\n* Use subheadings throughout the article."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.5
    },
    {
      "id": "c39ebdbe-0fd8-4a8a-8e6f-4f71f0593c4c",
      "name": "新文章表单",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1568,
        528
      ],
      "webhookId": "03bf5925-caac-4232-a081-14ed9c3d04d9",
      "parameters": {
        "options": {},
        "formTitle": "New article",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Article title",
              "placeholder": "10 ways to do Influencer Marketing in 2025",
              "requiredField": true
            },
            {
              "fieldLabel": "Article guidelines",
              "placeholder": "Promote xyz and write in British English...",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Fill in this form to trigger the generation of a new article."
      },
      "typeVersion": 2.3
    },
    {
      "id": "364b4077-2727-460d-b400-e7d39de4ec02",
      "name": "准备表单值",
      "type": "n8n-nodes-base.set",
      "position": [
        -1312,
        528
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ec4734ed-654f-478a-ab90-91bfcee1e208",
              "name": "Title",
              "type": "string",
              "value": "={{ $json['Article title'] }}"
            },
            {
              "id": "c034402e-a7b9-4c91-aaed-f24a838c3d91",
              "name": "Guidelines",
              "type": "string",
              "value": "={{ $json['Article guidelines'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d9122da2-a108-4e51-902f-4ffd62d0a69b",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -880,
        752
      ],
      "parameters": {
        "jsonSchemaExample": "[\n  {\n    \"question\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit?\"\n  },\n  {\n    \"question\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua?\"\n  },\n  {\n    \"question\": \"Lorem ipsum dolor sit amet?\"\n  },\n  {\n    \"question\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua, ut enim ad minim veniam?\"\n  },\n  {\n    \"question\": \"Lorem ipsum dolor sit amet, consectetur?\"\n  }\n]"
      },
      "typeVersion": 1.2
    },
    {
      "id": "fc390142-c963-46eb-9ec7-917ad1374a14",
      "name": "GPT 5 mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1008,
        752
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini",
          "cachedResultName": "gpt-5-mini"
        },
        "options": {
          "reasoningEffort": "low"
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "dMiSy27YCK6c6rra",
          "name": "Duv's OpenAI"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "fca117d9-a040-4e51-b938-c2125f33f040",
      "name": "拆分问题",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -608,
        528
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "output"
      },
      "typeVersion": 1
    },
    {
      "id": "6cc6e76b-1b0b-4aac-896b-57648949c9e5",
      "name": "循环处理问题",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -352,
        512
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "c017af5b-418e-4231-ae57-6c642324e0b9",
      "name": "GPT 5 聊天",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        224,
        176
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-chat-latest",
          "cachedResultName": "gpt-5-chat-latest"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "dMiSy27YCK6c6rra",
          "name": "Duv's OpenAI"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "908b7320-37b4-45c1-8fc5-c0670398ac49",
      "name": "文章结果",
      "type": "n8n-nodes-base.set",
      "position": [
        560,
        -48
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d3b8c4bc-27d9-4d57-b8d6-3a40b84d7b7d",
              "name": "Article",
              "type": "string",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e00af6b7-0d8a-410c-9d78-743a47b64d5b",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        512
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "height": 320,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "009734ed-642f-4916-a3b0-83fa2b6b32f9",
      "name": "聚合研究内容",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -112,
        160
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "Content to leverage"
      },
      "typeVersion": 1
    },
    {
      "id": "7e086700-f7cd-44e3-9f23-645a0ac63769",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        -256
      ],
      "parameters": {
        "width": 832,
        "height": 560,
        "content": "# 基于您知识库的 AI 文章撰写器"
      },
      "typeVersion": 1
    },
    {
      "id": "2311af8d-8f3b-4153-9e9a-94cbdfd995b5",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        384
      ],
      "parameters": {
        "color": 6,
        "width": 976,
        "height": 608,
        "content": "## 使用 Lookio 逐一回答每个子问题"
      },
      "typeVersion": 1
    },
    {
      "id": "b8d2e5a4-2390-4fd4-8b56-2d6a5e745d48",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -208
      ],
      "parameters": {
        "color": 5,
        "width": 368,
        "height": 512,
        "content": "## AI 步骤:基于研究和初始请求撰写最终文章"
      },
      "typeVersion": 1
    },
    {
      "id": "644b48e0-1bd3-470d-88ae-0a7da22e6eac",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        384
      ],
      "parameters": {
        "color": 6,
        "width": 480,
        "height": 608,
        "content": "## 将主题分解为子问题"
      },
      "typeVersion": 1
    },
    {
      "id": "c0c2508f-2d93-4246-be63-3fd73100ad32",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1648,
        400
      ],
      "parameters": {
        "color": 4,
        "width": 272,
        "height": 304,
        "content": "## 填写此表单以请求新文章"
      },
      "typeVersion": 1
    },
    {
      "id": "0b703c42-c0a9-4a49-84e9-4dfa60025d6e",
      "name": "查询 Lookio 助手",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -32,
        560
      ],
      "parameters": {
        "url": "https://api.lookio.app/webhook/query",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "query",
              "value": "={{ $json.question }}"
            },
            {
              "name": "assistant_id",
              "value": "<your-assistant-id>"
            },
            {
              "name": "query_mode",
              "value": "flash"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "api_key",
              "value": "<your-lookio-api-key>"
            }
          ]
        }
      },
      "typeVersion": 4.2
    }
  ],
  "connections": {
    "GPT 5 chat": {
      "ai_languageModel": [
        [
          {
            "node": "New content - Generate the AI output",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "GPT 5 mini": {
      "ai_languageModel": [
        [
          {
            "node": "New content - generate research questions",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "New article form": {
      "main": [
        [
          {
            "node": "Prepare form values",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Questions": {
      "main": [
        [
          {
            "node": "Aggregate research content",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Query Lookio Assistant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare form values": {
      "main": [
        [
          {
            "node": "New content - generate research questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Questions": {
      "main": [
        [
          {
            "node": "Loop Over Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query Lookio Assistant": {
      "main": [
        [
          {
            "node": "Format question and answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "New content - generate research questions",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate research content": {
      "main": [
        [
          {
            "node": "New content - Generate the AI output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format question and answer": {
      "main": [
        [
          {
            "node": "Loop Over Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New content - Generate the AI output": {
      "main": [
        [
          {
            "node": "Article result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New content - generate research questions": {
      "main": [
        [
          {
            "node": "Split Out Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 内容创作, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
高级
节点数量19
分类2
节点类型10
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Guillaume Duvernay

Guillaume Duvernay

@duv

AI and automation expert

外部链接
在 n8n.io 查看

分享此工作流