Générer des images pour les campagnes de médias sociaux avec Mistral AI et Pollinations.ai
Ceci est unContent Creation, Multimodal AIworkflow d'automatisation du domainecontenant 29 nœuds.Utilise principalement des nœuds comme Set, Code, Merge, GoogleDrive, HttpRequest. Utiliser Mistral AI et Pollinations.ai pour générer des images pour des campagnes sur les médias sociaux
- •Informations d'identification Google Drive API
- •Peut nécessiter les informations d'identification d'authentification de l'API cible
Nœuds utilisés (29)
Catégorie
{
"meta": {
"instanceId": "d2787088d49a05164783f5a9fa37e1730a27b190e51881d2128ba2bcd8c2656e",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "a5ea313b-3448-49a4-8c96-288aa01d91c2",
"name": "Lors du clic sur 'Tester le workflow'",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-2640,
128
],
"parameters": {},
"typeVersion": 1
},
{
"id": "3564a008-4f03-4d29-a02e-53bee57ea6f6",
"name": "Mistral Cloud Chat Model4",
"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": "Analyseur de sortie structurée1",
"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": "Envoyer en tant que fichier fusionné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": "Renommer en photo 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": "Renommer en photo 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": "Renommer en photo 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": "Renommer en photo 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": "Renommer en photo 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": "Générateur d'objectifs de campagne",
"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": "Générateur de prompts d'image basé sur l'objectif",
"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": "Objectifs de la marque",
"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": "Profil de la marque",
"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": "Note autocollante",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2416,
-96
],
"parameters": {
"color": 5,
"width": 384,
"height": 496,
"content": "## Get brand profile and goal saved in google drive"
},
"typeVersion": 1
},
{
"id": "670201ca-cb2f-4a6a-9115-c2c39e5cb381",
"name": "Note autocollante1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1616,
80
],
"parameters": {
"color": 5,
"width": 320,
"height": 432,
"content": "## AI AGENT generated Campaign Goal"
},
"typeVersion": 1
},
{
"id": "8e8cf2b3-b661-4175-951e-53b1044f7fa5",
"name": "Nettoyer les données récupérées",
"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": "Fusionner profil et objectifs",
"type": "n8n-nodes-base.merge",
"position": [
-2000,
192
],
"parameters": {},
"typeVersion": 3.1
},
{
"id": "4ad7d858-c0f8-4b1e-947c-0497a4235a58",
"name": "Note autocollante2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1232,
80
],
"parameters": {
"color": 5,
"width": 320,
"height": 432,
"content": "## AI AGENT generated prompt for image generation"
},
"typeVersion": 1
},
{
"id": "e3b98360-2cee-4d62-899f-cb9c9656a2fc",
"name": "Séparer chaque prompt",
"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": "Note autocollante3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-496,
-80
],
"parameters": {
"width": 304,
"height": 848,
"content": "## image is genearted using pollinations.ai"
},
"typeVersion": 1
},
{
"id": "f518b617-9be6-4ee2-bfa1-7d0d45d2d4f5",
"name": "Note autocollante4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-96,
-96
],
"parameters": {
"height": 864,
"content": "## each image name is normalized"
},
"typeVersion": 1
},
{
"id": "897b71c9-1c2b-422b-b602-fd6008d35091",
"name": "Fusionner les images en un seul élément",
"type": "n8n-nodes-base.merge",
"position": [
320,
128
],
"parameters": {
"numberInputs": 5
},
"typeVersion": 3
},
{
"id": "c6b6132c-761c-4dd1-b794-07710f313be4",
"name": "Téléverser le fichier",
"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": "Note autocollante5",
"type": "n8n-nodes-base.stickyNote",
"position": [
672,
64
],
"parameters": {
"width": 320,
"height": 320,
"content": "## save output to drive"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"b71a28a6-fb07-45ef-bd88-0a4823523718": {
"main": [
[
{
"node": "f19f78ca-0324-4afd-ad49-de461003855d",
"type": "main",
"index": 1
}
]
]
},
"52656d86-ec0f-4fee-9e38-5c471f94ac70": {
"main": [
[
{
"node": "f19f78ca-0324-4afd-ad49-de461003855d",
"type": "main",
"index": 0
}
]
]
},
"91e20d0a-5d6e-4773-bb24-9ca0d805b673": {
"main": [
[
{
"node": "b5309ec2-dcb4-4780-9c8a-279cd4fe2a84",
"type": "main",
"index": 0
}
]
]
},
"bde171b6-70f7-481f-b30e-9edee1ffa1c4": {
"main": [
[
{
"node": "7885edd1-1b0d-4625-ac48-0ba10f050edf",
"type": "main",
"index": 0
}
]
]
},
"74bd22ee-f617-4e94-8cb6-5dd7e355d31e": {
"main": [
[
{
"node": "d29bb3e1-9de2-4eec-a0a6-f3d691c3dab0",
"type": "main",
"index": 0
}
]
]
},
"2d4d8669-b540-4608-aea0-1d5f40a72cd6": {
"main": [
[
{
"node": "d01dd384-bf08-467f-81ae-5cb4d84ed029",
"type": "main",
"index": 0
}
]
]
},
"3e8e1878-d37c-4873-947b-c4e6bfdd60eb": {
"main": [
[
{
"node": "b56007b9-cd49-425d-b36c-fe083eef4e57",
"type": "main",
"index": 0
}
]
]
},
"8e8cf2b3-b661-4175-951e-53b1044f7fa5": {
"main": [
[
{
"node": "341d3e38-7706-47b1-aa7c-ee1e5793c8e3",
"type": "main",
"index": 0
}
]
]
},
"e3b98360-2cee-4d62-899f-cb9c9656a2fc": {
"main": [
[
{
"node": "91e20d0a-5d6e-4773-bb24-9ca0d805b673",
"type": "main",
"index": 0
},
{
"node": "bde171b6-70f7-481f-b30e-9edee1ffa1c4",
"type": "main",
"index": 0
},
{
"node": "74bd22ee-f617-4e94-8cb6-5dd7e355d31e",
"type": "main",
"index": 0
},
{
"node": "2d4d8669-b540-4608-aea0-1d5f40a72cd6",
"type": "main",
"index": 0
},
{
"node": "3e8e1878-d37c-4873-947b-c4e6bfdd60eb",
"type": "main",
"index": 0
}
]
]
},
"b5309ec2-dcb4-4780-9c8a-279cd4fe2a84": {
"main": [
[
{
"node": "897b71c9-1c2b-422b-b602-fd6008d35091",
"type": "main",
"index": 0
}
]
]
},
"7885edd1-1b0d-4625-ac48-0ba10f050edf": {
"main": [
[
{
"node": "897b71c9-1c2b-422b-b602-fd6008d35091",
"type": "main",
"index": 1
}
]
]
},
"d29bb3e1-9de2-4eec-a0a6-f3d691c3dab0": {
"main": [
[
{
"node": "897b71c9-1c2b-422b-b602-fd6008d35091",
"type": "main",
"index": 2
}
]
]
},
"b56007b9-cd49-425d-b36c-fe083eef4e57": {
"main": [
[
{
"node": "897b71c9-1c2b-422b-b602-fd6008d35091",
"type": "main",
"index": 4
}
]
]
},
"03d7ae13-ff9d-42d4-90d3-a9d031cbf56a": {
"main": [
[
{
"node": "c6b6132c-761c-4dd1-b794-07710f313be4",
"type": "main",
"index": 0
}
]
]
},
"341d3e38-7706-47b1-aa7c-ee1e5793c8e3": {
"main": [
[
{
"node": "10577fa8-9548-4f38-9751-32ba2acd48ab",
"type": "main",
"index": 0
}
]
]
},
"d01dd384-bf08-467f-81ae-5cb4d84ed029": {
"main": [
[
{
"node": "897b71c9-1c2b-422b-b602-fd6008d35091",
"type": "main",
"index": 3
}
]
]
},
"f19f78ca-0324-4afd-ad49-de461003855d": {
"main": [
[
{
"node": "8e8cf2b3-b661-4175-951e-53b1044f7fa5",
"type": "main",
"index": 0
}
]
]
},
"897b71c9-1c2b-422b-b602-fd6008d35091": {
"main": [
[
{
"node": "03d7ae13-ff9d-42d4-90d3-a9d031cbf56a",
"type": "main",
"index": 0
}
]
]
},
"3564a008-4f03-4d29-a02e-53bee57ea6f6": {
"ai_languageModel": [
[
{
"node": "10577fa8-9548-4f38-9751-32ba2acd48ab",
"type": "ai_languageModel",
"index": 0
},
{
"node": "341d3e38-7706-47b1-aa7c-ee1e5793c8e3",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"c1e94644-7133-48fe-b757-cd1093a0ff9a": {
"ai_outputParser": [
[
{
"node": "10577fa8-9548-4f38-9751-32ba2acd48ab",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"a5ea313b-3448-49a4-8c96-288aa01d91c2": {
"main": [
[
{
"node": "b71a28a6-fb07-45ef-bd88-0a4823523718",
"type": "main",
"index": 0
},
{
"node": "52656d86-ec0f-4fee-9e38-5c471f94ac70",
"type": "main",
"index": 0
}
]
]
},
"10577fa8-9548-4f38-9751-32ba2acd48ab": {
"main": [
[
{
"node": "e3b98360-2cee-4d62-899f-cb9c9656a2fc",
"type": "main",
"index": 0
}
]
]
}
}
}Comment utiliser ce workflow ?
Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.
Dans quelles scénarios ce workflow est-il adapté ?
Avancé - Création de contenu, IA Multimodale
Est-ce payant ?
Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.
Workflows recommandés
Rajeet Nair
@rnair1996Partager ce workflow