聊天机器人内容 Agent
这是一个Social Media, Multimodal AI领域的自动化工作流,包含 25 个节点。主要使用 Set, Agent, FacebookGraphApi, ChatTrigger, LmChatOpenAi 等节点。 使用 Perplexity AI 和 Facebook Graph API 的研究到社交帖子生成器
- •Facebook Graph API 凭证
- •OpenAI API Key
使用的节点 (25)
{
"id": "N2Pc8CYYmgYeCihm",
"meta": {
"instanceId": "2b69b24ad1a51b447e1a0d6f8c70b16aca715ccfaf123eb531f92865766fce1c",
"templateCredsSetupCompleted": true
},
"name": "聊天机器人内容 Agent",
"tags": [],
"nodes": [
{
"id": "71fa822b-c898-4ff6-ad65-175ead2a5a33",
"name": "聊天触发器",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-416,
80
],
"parameters": {
"public": true,
"options": {},
"initialMessages": "Hi there! 👋\nI'm your Content Assistant. I can research with Perplexity and draft posts for you.\nHow can I help today?"
},
"notesInFlow": true,
"typeVersion": 1.1
},
{
"id": "69fdd569-4d6d-4d21-aac7-5ea3c00ad7f1",
"name": "工具:调用 Perplexity Researcher",
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"position": [
64,
304
],
"parameters": {
"name": "Perplexity_Research_Tool",
"workflowId": {
"__rl": true,
"mode": "id",
"value": ""
},
"description": "{{ new Date().toISOString() }}",
"workflowInputs": {
"value": {},
"schema": [],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
}
},
"typeVersion": 2.1
},
{
"id": "3a2f2d0c-f3bf-47c7-b1bb-ad9870a7f0ca",
"name": "Agent:主题 + 研究",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-144,
80
],
"parameters": {
"text": "={{$now}}\nPhân tích tự đề\n{{ $json.chatInput }}",
"options": {
"systemMessage": "User the perplexity_research_too, to provide research on the users topic"
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.8
},
{
"id": "d399f15d-6d71-4a91-a333-3d24ba8f8b2d",
"name": "解析器:文章 JSON",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
432,
288
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"article\": {\n \"type\": \"object\",\n \"required\": [\"title\", \"subtitle\", \"content\", \"hashtags\"],\n \"properties\": {\n \"title\": {\n \"type\": \"string\",\n \"description\": \"Article title\"\n },\n \"subtitle\": {\n \"type\": \"string\",\n \"description\": \"Article subtitle\"\n },\n \"content\": {\n \"type\": \"object\",\n \"properties\": {\n \"mainText\": {\n \"type\": \"string\",\n \"description\": \"Main article content\"\n },\n \"sections\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"title\": {\n \"type\": \"string\",\n \"description\": \"Section title\"\n },\n \"text\": {\n \"type\": \"string\",\n \"description\": \"Section content\"\n },\n \"quote\": {\n \"type\": \"string\",\n \"description\": \"Blockquote text\"\n }\n },\n \"required\": [\"title\", \"text\", \"quote\"]\n }\n }\n },\n \"required\": [\"mainText\", \"sections\"]\n },\n \"hashtags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Article hashtags\"\n }\n }\n }\n }\n}\n"
},
"typeVersion": 1.2
},
{
"id": "376491c5-e9e4-4eed-837c-fc751ea846d0",
"name": "LM:用于主题 Agent",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-176,
288
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "f25ea7f9-ccf4-4b70-9fad-e0f373f97cca",
"name": "LM:用于 JSON 提取",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
272,
288
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o",
"cachedResultName": "gpt-4o"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "eef73ee5-3efb-46ac-8d7a-f66301748a05",
"name": "Agent:提取 JSON",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
272,
80
],
"parameters": {
"text": "=Extract a JSON object from this content:{{ $json.output }} and also fill this fields that is missing (exclude quote)\n",
"options": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.8
},
{
"id": "5628d8ff-0381-4703-b8c3-dfa972eeded6",
"name": "解析器:帖子字段",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1024,
32
],
"parameters": {
"jsonSchemaExample": "{\n \"title\": \"The headline for the social media post\",\n \"subtitle\": \"The subtitle of the social post that I can put onto the poster\",\n \"content\": \"The formatted social media post\"\n}"
},
"typeVersion": 1.2
},
{
"id": "309a55bc-250c-40e6-812d-5adae1aa411d",
"name": "LM:用于帖子撰写器",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
800,
32
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "a459abd4-6193-473b-aa06-5f02cdf137ba",
"name": "Agent:创建帖子内容",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
800,
-176
],
"parameters": {
"text": "=Convert this JSON into a concise and engaging blog in Vietnamese Language: {{$json.output.article.toJsonString() }}\n\n## Formatting Guidelines\n- Write posts in a clear, natural tone\n- Use the title of the post as the opening line or focus.\n- Use emojis to highlight key ideas, e.g. 🌺 , l🔥 , 📣,\n- Keep content short and sweet, don't translate every word, but make sure the meaning flows and is easy to read.\n- Add compelling calls to action (CTA) such as: “See more now!”, “What do you think? Comment! 🚀”.\n- Use hashtags from the “hashtags” field in JSON to increase accessibility\n- Quotes or key ideas should be emphasized with quotation marks: “…” or add emoji: 💬 .\n- Avoid long sentences; keep the post easy to understand.\n- Make sure Vietnamese spelling and grammar are correct\n- Please do not use symbols such as ** or *",
"options": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.8
},
{
"id": "15c2b1b8-10f6-4c63-a790-9caf41337734",
"name": "发布:Facebook Graph API",
"type": "n8n-nodes-base.facebookGraphApi",
"position": [
1360,
-176
],
"parameters": {
"edge": "feed",
"node": "YOUR_FACEBOOK_PAGE_ID",
"options": {
"queryParameters": {
"parameter": [
{
"name": "message",
"value": "={{ $json.output }}.replaceall(\"*\",\"\")\n"
}
]
}
},
"graphApiVersion": "v22.0",
"httpRequestMethod": "POST"
},
"typeVersion": 1
},
{
"id": "6d051ca3-731a-4527-82b2-fab006a48c6f",
"name": "⚙️ 配置(设置字段)",
"type": "n8n-nodes-base.set",
"position": [
-760,
-200
],
"parameters": {
"fields": {
"values": [
{
"name": "FACEBOOK_PAGE_ID",
"stringValue": "YOUR_FACEBOOK_PAGE_ID"
},
{
"name": "FACEBOOK_EDGE",
"stringValue": "feed"
},
{
"name": "RESEARCH_WORKFLOW_ID",
"stringValue": "YOUR_RESEARCH_WORKFLOW_ID"
},
{
"name": "POST_EMOJI_STYLE",
"stringValue": "🔥 🚀 💬"
},
{
"name": "LANGUAGE",
"stringValue": "vi-VN"
}
]
},
"include": "none",
"options": {}
},
"typeVersion": 3.4
},
{
"id": "5a0344d3-386b-4a0b-b1bc-cd5927a25ac0",
"name": "便签:概述",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1160,
-420
],
"parameters": {
"color": 2,
"width": 720,
"height": 540,
"content": "## 适用对象"
},
"typeVersion": 1
},
{
"id": "e78a233a-5e1e-4091-9ab9-ff0d40bdcb22",
"name": "便签:聊天触发器",
"type": "n8n-nodes-base.stickyNote",
"position": [
-196,
40
],
"parameters": {
"color": 4,
"width": 420,
"height": 180,
"content": "## 聊天触发器"
},
"typeVersion": 1
},
{
"id": "7f547b8b-ff5f-4fcb-a9ac-7f96b700103b",
"name": "便签:Agent:主题 + 研究",
"type": "n8n-nodes-base.stickyNote",
"position": [
76,
40
],
"parameters": {
"color": 4,
"width": 420,
"height": 180,
"content": "## Agent:主题 + 研究"
},
"typeVersion": 1
},
{
"id": "2179ad75-830c-472a-af6e-3a1044817885",
"name": "便签:工具:调用 Perplexity Researcher",
"type": "n8n-nodes-base.stickyNote",
"position": [
284,
264
],
"parameters": {
"color": 4,
"width": 420,
"height": 180,
"content": "## 工具:调用 Perplexity Researcher"
},
"typeVersion": 1
},
{
"id": "9e6152da-84fd-46a7-bff8-dcd0a404f618",
"name": "便签:解析器:文章 JSON",
"type": "n8n-nodes-base.stickyNote",
"position": [
652,
248
],
"parameters": {
"color": 4,
"width": 420,
"height": 180,
"content": "## 解析器:文章 JSON"
},
"typeVersion": 1
},
{
"id": "f0bc973b-506b-45ee-86f1-96b3bda1e823",
"name": "便签:Agent:提取 JSON",
"type": "n8n-nodes-base.stickyNote",
"position": [
492,
40
],
"parameters": {
"color": 4,
"width": 420,
"height": 180,
"content": "## Agent:提取 JSON"
},
"typeVersion": 1
},
{
"id": "64905994-b151-4b83-bf76-ec15fff86e80",
"name": "便签:解析器:帖子字段",
"type": "n8n-nodes-base.stickyNote",
"position": [
1244,
-8
],
"parameters": {
"color": 4,
"width": 420,
"height": 180,
"content": "## 解析器:帖子字段"
},
"typeVersion": 1
},
{
"id": "cea84b3d-fa70-485c-82d9-82a026d26000",
"name": "便签:Agent:创建帖子内容",
"type": "n8n-nodes-base.stickyNote",
"position": [
1020,
-216
],
"parameters": {
"color": 4,
"width": 420,
"height": 180,
"content": "## Agent:创建帖子内容"
},
"typeVersion": 1
},
{
"id": "7d623d22-70f2-428e-80fc-d5998292308a",
"name": "便签:LM:用于主题 Agent",
"type": "n8n-nodes-base.stickyNote",
"position": [
44,
248
],
"parameters": {
"color": 4,
"width": 420,
"height": 180,
"content": "## 用于主题 Agent 的 LM"
},
"typeVersion": 1
},
{
"id": "a09e5aba-19fa-4067-b238-eacd4911b38d",
"name": "便签:LM:用于 JSON 提取",
"type": "n8n-nodes-base.stickyNote",
"position": [
492,
248
],
"parameters": {
"color": 4,
"width": 420,
"height": 180,
"content": "## 用于 JSON 提取的 LM"
},
"typeVersion": 1
},
{
"id": "1934213e-efbe-43a5-b1a7-b0c8327f568d",
"name": "便签:LM:用于帖子撰写器",
"type": "n8n-nodes-base.stickyNote",
"position": [
1020,
-8
],
"parameters": {
"color": 4,
"width": 420,
"height": 180,
"content": "## 用于帖子撰写器的 LM"
},
"typeVersion": 1
},
{
"id": "35a55b97-1b2f-475a-b82f-4fc848bfcae1",
"name": "便签:发布:Facebook Graph API",
"type": "n8n-nodes-base.stickyNote",
"position": [
1580,
-216
],
"parameters": {
"color": 4,
"width": 420,
"height": 180,
"content": "## 发布:Facebook Graph API"
},
"typeVersion": 1
},
{
"id": "ae438cec-a8a7-4ce9-b5f9-6033ee75ba13",
"name": "便签:模板检查清单",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1160,
220
],
"parameters": {
"color": 4,
"width": 480,
"height": 220,
"content": "## 模板检查清单"
},
"typeVersion": 1
}
],
"active": true,
"pinData": {},
"settings": {
"timezone": "Asia/Bangkok",
"callerPolicy": "workflowsFromSameOwner",
"executionOrder": "v1"
},
"versionId": "ce4b61cd-82e5-4bec-8097-6e61ada3f23c",
"connections": {
"Extract Json": {
"main": [
[
{
"node": "Create Post Content",
"type": "main",
"index": 0
}
]
]
},
"Perplexity Topic": {
"main": [
[
{
"node": "Extract Json",
"type": "main",
"index": 0
}
]
]
},
"Create Post Content": {
"main": [
[
{
"node": "Facebook Graph API",
"type": "main",
"index": 0
}
]
]
},
"OpenAI GPT-4o-mini2": {
"ai_languageModel": [
[
{
"node": "Perplexity Topic",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI GPT-4o-mini3": {
"ai_languageModel": [
[
{
"node": "Extract Json",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI GPT-4o-mini4": {
"ai_languageModel": [
[
{
"node": "Create Post Content",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Extract Json",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Structured Output Parser1": {
"ai_outputParser": [
[
{
"node": "Create Post Content",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Call Perplexity Researcher": {
"ai_tool": [
[
{
"node": "Perplexity Topic",
"type": "ai_tool",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "Perplexity Topic",
"type": "main",
"index": 0
}
]
]
}
}
}如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 社交媒体, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
HoangSP
@hoangspHoangSP is an automation expert with deep experience in using n8n, the open-source workflow automation platform. He regularly creates and shares practical automation templates with the n8n community, helping individuals and businesses save time, boost efficiency, and seamlessly integrate their tools and systems. With a strong systems-thinking approach and a talent for process optimization, HoangSP is a leading figure in Vietnam’s growing automation space.
分享此工作流