使用 Mistral AI 和 Pollinations.ai 生成社交媒体活动图片
高级
这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 29 个节点。主要使用 Set, Code, Merge, GoogleDrive, HttpRequest 等节点。 使用 Mistral AI 和 Pollinations.ai 生成社交媒体活动图片
前置要求
- •Google Drive API 凭证
- •可能需要目标 API 的认证凭证
使用的节点 (29)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"meta": {
"instanceId": "d2787088d49a05164783f5a9fa37e1730a27b190e51881d2128ba2bcd8c2656e",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "a5ea313b-3448-49a4-8c96-288aa01d91c2",
"name": "当点击\"测试工作流\"时",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-2640,
128
],
"parameters": {},
"typeVersion": 1
},
{
"id": "3564a008-4f03-4d29-a02e-53bee57ea6f6",
"name": "Mistral云聊天模型4",
"type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
"position": [
-1424,
480
],
"parameters": {
"model": "mistral-small-latest",
"options": {
"temperature": 0.9
}
},
"credentials": {
"mistralCloudApi": {
"id": "n3lOZuA7dCVheVwc",
"name": "Mistral Cloud account"
}
},
"typeVersion": 1
},
{
"id": "c1e94644-7133-48fe-b757-cd1093a0ff9a",
"name": "结构化输出解析器1",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
-1184,
432
],
"parameters": {
"jsonSchemaExample": "{\n \"output\": {\n \"image_prompts\": [\n {\n \"prompt\": \"\"\n },\n {\n \"prompt\": \"\"\n },\n {\n \"prompt\": \"\"\n },\n {\n \"prompt\": \"\"\n },\n {\n \"prompt\": \"\"\n }\n ],\n \"caption\": \"\",\n \"hashtags\": [\n \n ]\n }\n}\n"
},
"typeVersion": 1.2
},
{
"id": "91e20d0a-5d6e-4773-bb24-9ca0d805b673",
"name": "pollinations.ai",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"maxTries": 5,
"position": [
-400,
32
],
"parameters": {
"url": "=https://image.pollinations.ai/prompt/{{ $json.prompt1 }}",
"options": {}
},
"retryOnFail": true,
"typeVersion": 4.2
},
{
"id": "bde171b6-70f7-481f-b30e-9edee1ffa1c4",
"name": "pollinations.ai2",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"maxTries": 5,
"position": [
-400,
160
],
"parameters": {
"url": "=https://image.pollinations.ai/prompt/{{ $json.prompt2 }}",
"options": {}
},
"retryOnFail": true,
"typeVersion": 4.2
},
{
"id": "74bd22ee-f617-4e94-8cb6-5dd7e355d31e",
"name": "pollinations.ai3",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"maxTries": 5,
"position": [
-384,
320
],
"parameters": {
"url": "=https://image.pollinations.ai/prompt/{{ $json.prompt3 }}",
"options": {}
},
"retryOnFail": true,
"typeVersion": 4.2
},
{
"id": "2d4d8669-b540-4608-aea0-1d5f40a72cd6",
"name": "pollinations.ai4",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"maxTries": 5,
"position": [
-384,
464
],
"parameters": {
"url": "=https://image.pollinations.ai/prompt/{{ $json.prompt4 }}",
"options": {}
},
"retryOnFail": true,
"typeVersion": 4.2
},
{
"id": "3e8e1878-d37c-4873-947b-c4e6bfdd60eb",
"name": "pollinations.ai5",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"maxTries": 5,
"position": [
-384,
608
],
"parameters": {
"url": "=https://image.pollinations.ai/prompt/{{ $json.prompt5 }}",
"options": {}
},
"retryOnFail": true,
"typeVersion": 4.2
},
{
"id": "03d7ae13-ff9d-42d4-90d3-a9d031cbf56a",
"name": "作为1个合并文件发送1",
"type": "n8n-nodes-base.code",
"position": [
528,
176
],
"parameters": {
"jsCode": "// Merge all incoming items (each with one binary photoX) into one item\nconst mergedItem = {\n json: {},\n binary: {}\n};\n\nfor (const item of items) {\n // Copy every binary field from each item into mergedItem.binary\n for (const [key, bin] of Object.entries(item.binary || {})) {\n mergedItem.binary[key] = bin;\n }\n}\n\n// Return a single-item array\nreturn [mergedItem];\n"
},
"typeVersion": 2
},
{
"id": "b5309ec2-dcb4-4780-9c8a-279cd4fe2a84",
"name": "重命名为照片1",
"type": "n8n-nodes-base.code",
"position": [
0,
0
],
"parameters": {
"jsCode": "return items.map((item, index) => {\n // Grab the existing binary buffer under \"data\"\n const buffer = item.binary.data;\n // Build a new item with the renamed binary key\n return {\n json: item.json,\n binary: {\n // Rename to photo1, photo2, ...\n [`photo${index + 1}`]: buffer\n }\n };\n});\n"
},
"typeVersion": 2
},
{
"id": "7885edd1-1b0d-4625-ac48-0ba10f050edf",
"name": "重命名为照片2",
"type": "n8n-nodes-base.code",
"position": [
0,
160
],
"parameters": {
"jsCode": "return items.map((item, index) => {\n // Grab the existing binary buffer under \"data\"\n const buffer = item.binary.data;\n // Build a new item with the renamed binary key\n return {\n json: item.json,\n binary: {\n // Rename to photo1, photo2, ...\n [`photo${index + 2}`]: buffer\n }\n };\n});\n"
},
"typeVersion": 2
},
{
"id": "d29bb3e1-9de2-4eec-a0a6-f3d691c3dab0",
"name": "重命名为照片3",
"type": "n8n-nodes-base.code",
"position": [
0,
304
],
"parameters": {
"jsCode": "return items.map((item, index) => {\n // Grab the existing binary buffer under \"data\"\n const buffer = item.binary.data;\n // Build a new item with the renamed binary key\n return {\n json: item.json,\n binary: {\n // Rename to photo1, photo2, ...\n [`photo${index + 3}`]: buffer\n }\n };\n});\n"
},
"typeVersion": 2
},
{
"id": "d01dd384-bf08-467f-81ae-5cb4d84ed029",
"name": "重命名为照片4",
"type": "n8n-nodes-base.code",
"position": [
0,
448
],
"parameters": {
"jsCode": "return items.map((item, index) => {\n // Grab the existing binary buffer under \"data\"\n const buffer = item.binary.data;\n // Build a new item with the renamed binary key\n return {\n json: item.json,\n binary: {\n // Rename to photo1, photo2, ...\n [`photo${index + 4}`]: buffer\n }\n };\n});\n"
},
"typeVersion": 2
},
{
"id": "b56007b9-cd49-425d-b36c-fe083eef4e57",
"name": "重命名为照片5",
"type": "n8n-nodes-base.code",
"position": [
0,
592
],
"parameters": {
"jsCode": "return items.map((item, index) => {\n // Grab the existing binary buffer under \"data\"\n const buffer = item.binary.data;\n // Build a new item with the renamed binary key\n return {\n json: item.json,\n binary: {\n // Rename to photo1, photo2, ...\n [`photo${index + 5}`]: buffer\n }\n };\n});\n"
},
"typeVersion": 2
},
{
"id": "341d3e38-7706-47b1-aa7c-ee1e5793c8e3",
"name": "营销目标生成器",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-1584,
208
],
"parameters": {
"text": "={{ $json.company }}",
"options": {
"systemMessage": "=You are an expert marketing strategiste who can creat great Carousels for social media \n\nuse data provide in user query \nTask: Produce two clear sections:\ngoals :{{ $json.campaign.focus }}\naudeince: {{ $json.campaign.success_metric }}\nkeyword :{{ $json.campaign.keywords }}\nsucess metric {{ $json.campaign.success_metric }}\n--- \n**Company Summary ** \n- Name \n- Mission \n- Vision \n- Core Values (bullet list) \n- Services (bullet list) \n- Tone & Voice \n- Key Keywords (comma-separated) \n- Proof Points (case studies + clients)\n\n--- \n**Campaign Goal Summary** \n- Primary Goal \n- Focus \n- Success Metric \n- Target Audience \n- Core Message (one sentence)\n"
},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "10577fa8-9548-4f38-9751-32ba2acd48ab",
"name": "基于目标生成图片提示",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-1216,
208
],
"parameters": {
"text": "={{ $json.output }}",
"options": {
"systemMessage": "Create 5 powerful image generation prompts that tell a clear, compelling story about our brand’s AI capabilities — one visual at a time. The sequence should reflect transformation or progress, told entirely through visuals. use user message in each step planning\n\nOnly one of the five should include a strong caption.\nAlso include one shared hashtag block with 4–6 relevant and commonly used tags.\n\nUse simple language. Do not suggest content topics or fixed publishing days.\nOnly return:\n\n5 image generation prompts\n\n1 caption \n\n1 hashtag block\n\ngive output in json {\n \"output\": {\n \"image_prompts\": [\n {\n \"prompt\": \"\"\n },\n {\n \"prompt\": \"\"\n },\n {\n \"prompt\": \"\"\n },\n {\n \"prompt\": \"\"\n },\n {\n \"prompt\": \"\"\n }\n ],\n \"caption\": \"\",\n \"hashtags\": [\n \"\",\n \"\",\n \"\",\n \"\",\n \"\",\n \"\"\n ]\n }\n}\n"
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2
},
{
"id": "b71a28a6-fb07-45ef-bd88-0a4823523718",
"name": "品牌目标",
"type": "n8n-nodes-base.googleDrive",
"position": [
-2272,
224
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "url",
"value": "",
"__regex": "https:\\/\\/(?:drive|docs)\\.google\\.com(?:\\/.*|)\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)"
},
"options": {},
"operation": "download"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "ukOlw9NKhJMJxRUB",
"name": "Google Drive account 2"
}
},
"typeVersion": 3
},
{
"id": "52656d86-ec0f-4fee-9e38-5c471f94ac70",
"name": "品牌档案",
"type": "n8n-nodes-base.googleDrive",
"position": [
-2272,
-16
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "url",
"value": "",
"__regex": "https:\\/\\/(?:drive|docs)\\.google\\.com(?:\\/.*|)\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)"
},
"options": {},
"operation": "download"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "ukOlw9NKhJMJxRUB",
"name": "Google Drive account 2"
}
},
"typeVersion": 3
},
{
"id": "6d845bac-de42-4d9f-b645-1ff7204c5a8b",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2416,
-96
],
"parameters": {
"color": 5,
"width": 384,
"height": 496,
"content": "## 获取保存在Google云端硬盘中的品牌档案和目标"
},
"typeVersion": 1
},
{
"id": "670201ca-cb2f-4a6a-9115-c2c39e5cb381",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1616,
80
],
"parameters": {
"color": 5,
"width": 320,
"height": 432,
"content": "## AI代理生成的营销目标"
},
"typeVersion": 1
},
{
"id": "8e8cf2b3-b661-4175-951e-53b1044f7fa5",
"name": "清理检索到的数据",
"type": "n8n-nodes-base.code",
"position": [
-1792,
192
],
"parameters": {
"jsCode": "const result = {\n summaries: [],\n company: {},\n campaign: {}\n};\n\nfor (const item of items) {\n const json = item.json;\n\n // 1. Handle summary + hashtags\n if (json.row_number && json[\"summary \"]) {\n const summaryText = JSON.parse(json[\"summary \"])?.text?.trim();\n result.summaries.push({\n summary_id: `trend_summary_${json.row_number}`,\n text: summaryText || \"\",\n hashtags: [],\n row_number: json.row_number\n });\n }\n\n // 2. Add hashtags to corresponding summary\n if (json.row_number && json[\"hastag \"]) {\n const tagList = JSON.parse(json[\"hastag \"]);\n const match = result.summaries.find(s => s.row_number === json.row_number);\n if (match) match.hashtags = tagList;\n }\n\n // 3. Capture company profile\n if (json.id === \"c182f59e-4819-4390-abc8-117b0a878abc\") {\n result.company = {\n name: json.name,\n mission: json.mission,\n vision: json.vision,\n values: json.values,\n services: json.services,\n contact: json.contact_details,\n social_links: json.social_links,\n location: json.location,\n tone: json.tone_of_voice,\n seo_keywords: json.seo_keywords,\n testimonials: json.testimonials,\n };\n }\n\n // 4. Capture campaign data\n if (json.company_id === \"c182f59e-4819-4390-abc8-117b0a878abc\" && json.campaign_goal) {\n result.campaign = {\n goal: json.campaign_goal,\n focus: json.focus,\n success_metric: json.success_metric,\n target_audience: json.target_audience,\n customer_base: json.customer_base,\n keywords: json.keywords,\n company_name: json.name\n };\n }\n}\n\n// Optional: remove row_number after matching\nfor (const s of result.summaries) {\n delete s.row_number;\n}\n\nreturn [\n {\n json: result\n }\n];\n"
},
"typeVersion": 2
},
{
"id": "f19f78ca-0324-4afd-ad49-de461003855d",
"name": "合并档案和目标",
"type": "n8n-nodes-base.merge",
"position": [
-2000,
192
],
"parameters": {},
"typeVersion": 3.1
},
{
"id": "4ad7d858-c0f8-4b1e-947c-0497a4235a58",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1232,
80
],
"parameters": {
"color": 5,
"width": 320,
"height": 432,
"content": "## AI代理生成的图片生成提示"
},
"typeVersion": 1
},
{
"id": "e3b98360-2cee-4d62-899f-cb9c9656a2fc",
"name": "分离每个提示",
"type": "n8n-nodes-base.set",
"position": [
-864,
224
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "b70f1cfd-d12e-469d-864d-0034860cd00e",
"name": "prompt1",
"type": "string",
"value": "={{ $json.output.image_prompts[0].prompt }}"
},
{
"id": "4d7f371c-e8f9-4941-a322-153607d01938",
"name": "prompt2",
"type": "string",
"value": "={{ $json.output.image_prompts[1].prompt }}"
},
{
"id": "55f99acf-7f3c-4c8d-b674-2b90c0760893",
"name": "prompt3",
"type": "string",
"value": "={{ $json.output.image_prompts[2].prompt }}"
},
{
"id": "4b14808a-d512-4b47-9008-573e092996e4",
"name": "prompt4",
"type": "string",
"value": "={{ $json.output.image_prompts[3].prompt }}"
},
{
"id": "435b6cfb-6d4b-42e7-afd4-8f387698eec1",
"name": "prompt5",
"type": "string",
"value": "={{ $json.output.image_prompts[4].prompt }}"
}
]
}
},
"typeVersion": "3.4"
},
{
"id": "9f4cc553-ebbe-4621-89af-019eaefedfdc",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-496,
-80
],
"parameters": {
"width": 304,
"height": 848,
"content": "## 使用pollinations.ai生成图片"
},
"typeVersion": 1
},
{
"id": "f518b617-9be6-4ee2-bfa1-7d0d45d2d4f5",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-96,
-96
],
"parameters": {
"height": 864,
"content": "## 每个图片名称已标准化"
},
"typeVersion": 1
},
{
"id": "897b71c9-1c2b-422b-b602-fd6008d35091",
"name": "将图片合并为一个项目",
"type": "n8n-nodes-base.merge",
"position": [
320,
128
],
"parameters": {
"numberInputs": 5
},
"typeVersion": 3
},
{
"id": "c6b6132c-761c-4dd1-b794-07710f313be4",
"name": "上传文件",
"type": "n8n-nodes-base.googleDrive",
"position": [
736,
176
],
"parameters": {
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "root",
"cachedResultName": "/ (Root folder)"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "ukOlw9NKhJMJxRUB",
"name": "Google Drive account 2"
}
},
"typeVersion": 3
},
{
"id": "76f8fc04-be8f-4b5d-b685-4c8ba77668c2",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
672,
64
],
"parameters": {
"width": 320,
"height": 320,
"content": "## 保存输出到云端硬盘"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"brand goals": {
"main": [
[
{
"node": "Merge profile and goals",
"type": "main",
"index": 1
}
]
]
},
"brand profile": {
"main": [
[
{
"node": "Merge profile and goals",
"type": "main",
"index": 0
}
]
]
},
"pollinations.ai": {
"main": [
[
{
"node": "Change name to photo 1",
"type": "main",
"index": 0
}
]
]
},
"pollinations.ai2": {
"main": [
[
{
"node": "Change name to photo 2",
"type": "main",
"index": 0
}
]
]
},
"pollinations.ai3": {
"main": [
[
{
"node": "Change name to photo 3",
"type": "main",
"index": 0
}
]
]
},
"pollinations.ai4": {
"main": [
[
{
"node": "Change name to photo 4",
"type": "main",
"index": 0
}
]
]
},
"pollinations.ai5": {
"main": [
[
{
"node": "Change name to photo 5",
"type": "main",
"index": 0
}
]
]
},
"clean retrived data": {
"main": [
[
{
"node": "Campaign Goal generator",
"type": "main",
"index": 0
}
]
]
},
"separate each Prompts": {
"main": [
[
{
"node": "pollinations.ai",
"type": "main",
"index": 0
},
{
"node": "pollinations.ai2",
"type": "main",
"index": 0
},
{
"node": "pollinations.ai3",
"type": "main",
"index": 0
},
{
"node": "pollinations.ai4",
"type": "main",
"index": 0
},
{
"node": "pollinations.ai5",
"type": "main",
"index": 0
}
]
]
},
"Change name to photo 1": {
"main": [
[
{
"node": "Merge image into one item",
"type": "main",
"index": 0
}
]
]
},
"Change name to photo 2": {
"main": [
[
{
"node": "Merge image into one item",
"type": "main",
"index": 1
}
]
]
},
"Change name to photo 3": {
"main": [
[
{
"node": "Merge image into one item",
"type": "main",
"index": 2
}
]
]
},
"Change name to photo 5": {
"main": [
[
{
"node": "Merge image into one item",
"type": "main",
"index": 4
}
]
]
},
"Send as 1 merged file1": {
"main": [
[
{
"node": "Upload file",
"type": "main",
"index": 0
}
]
]
},
"Campaign Goal generator": {
"main": [
[
{
"node": "image prompt generator base on the goal",
"type": "main",
"index": 0
}
]
]
},
"Change name to photo 4": {
"main": [
[
{
"node": "Merge image into one item",
"type": "main",
"index": 3
}
]
]
},
"Merge profile and goals": {
"main": [
[
{
"node": "clean retrived data",
"type": "main",
"index": 0
}
]
]
},
"Merge image into one item": {
"main": [
[
{
"node": "Send as 1 merged file1",
"type": "main",
"index": 0
}
]
]
},
"Mistral Cloud Chat Model4": {
"ai_languageModel": [
[
{
"node": "image prompt generator base on the goal",
"type": "ai_languageModel",
"index": 0
},
{
"node": "Campaign Goal generator",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structured Output Parser1": {
"ai_outputParser": [
[
{
"node": "image prompt generator base on the goal",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"When clicking ‘Test workflow’": {
"main": [
[
{
"node": "brand goals",
"type": "main",
"index": 0
},
{
"node": "brand profile",
"type": "main",
"index": 0
}
]
]
},
"image prompt generator base on the goal": {
"main": [
[
{
"node": "separate each Prompts",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 内容创作, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
使用Mistral OCR和Gmail人工验证提取工时表数据
使用Mistral OCR和Gmail人工验证提取工时表数据
Set
Code
Gmail
+10
32 节点Rajeet Nair
内容创作
人工介入式帖子设计器(Mistral AI、ImageKit 和 LinkedIn 发布)
结合 Mistral AI、ImageKit 和 LinkedIn 发布的人工介入式帖子设计器
S3
Set
Gmail
+9
25 节点Rajeet Nair
内容创作
使用 OpenAI、ElevenLabs 和 Fal.ai 自动化病毒式内容创作,适用于视频、播客和 ASMR
使用 OpenAI、ElevenLabs 和 Fal.ai 自动化病毒式内容创作,适用于视频、播客和 ASMR
Set
Code
Wait
+16
97 节点Adam Crafts
内容创作
将服装图片上传到Cloudinary并使用Azure OpenAI (GPT-4o) 记录到工作表
使用GPT-4o、Cloudinary和Google Sheets处理和编目服装图片
Set
Code
Merge
+9
26 节点Rahul Joshi
内容创作
基于Twitter和YouTube趋势使用Mistral AI生成社交媒体标签
基于Twitter和YouTube趋势使用Mistral AI生成社交媒体标签
Code
Html
Merge
+8
15 节点Rajeet Nair
内容创作
💥 使用NanoBanana、Seedream 4、ChatGPT Image和Veo 3自动化视频广告 - VIDE
使用AI(NanoBanana、Seedream、GPT-4o、Veo 3)自动化和发布视频广告活动
Set
Code
Wait
+16
63 节点Dr. Firas
内容创作