This workflow follows the Agent → Chat Trigger recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "H0lwQeRTWnK9AfTR",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Facebook Post Automation",
"tags": [
{
"id": "YWorFyHcq8UfkgdY",
"name": "Social Media Automation",
"createdAt": "2025-06-11T03:15:35.832Z",
"updatedAt": "2025-06-11T03:15:35.832Z"
}
],
"nodes": [
{
"id": "cf34bdd0-6e61-41f1-9d71-d44b456fb63e",
"name": "Generate Image (Recraft.ai)",
"type": "n8n-nodes-base.httpRequest",
"position": [
1328,
-592
],
"parameters": {
"url": "https://external.api.recraft.ai/v1/images/generations",
"method": "POST",
"options": {
"response": {},
"allowUnauthorizedCerts": true
},
"jsonBody": "={\n \"prompt\": \"{{ $json.output.image_prompt_brief }}\",\n \"style\": \"digital_illustration\",\n \"substyle\": \"young_adult_book_2\",\n \"size\": \"1024x1024\"\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "1ec91a12-971e-48ff-af77-86a35abd4937",
"name": "Create FB Post Content",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
544,
-592
],
"parameters": {
"text": "=the word: {{ $json.word }}",
"options": {
"systemMessage": "=# ROLE:\nYou are a friendly and knowledgeable Chinese language guru creating viral content for your Thai followers on Facebook. Your persona is like a helpful older friend who makes learning fun and easy. Your goal is to not just teach a word, but to make your followers feel confident using it. \n\n# TASK:\nCreate an engaging and shareable Facebook post to teach a Chinese word. The post must be written primarily in Thai, with Chinese and Pinyin where appropriate. It should be easy to read, visually appealing with emojis, and encourage interaction.\n\n# INPUT:\n1. Thai Word: {thai_meaning or slang}\n2. Chinese Word: {chinese_character}\n3. Pinyin: {pinyin}\n4. Post Ideas : {ideas}\n\n# INSTRUCTIONS & STRUCTURE:\n1. Engaging Hook (\u0e1b\u0e23\u0e30\u0e42\u0e22\u0e04\u0e40\u0e1b\u0e34\u0e14):\nStart with a relatable question or a captivating statement in Thai to grab your audience's attention. Make them think, \"Oh, I've always wanted to know how to say that!\"\n\n2. Core Vocabulary (\u0e41\u0e19\u0e30\u0e19\u0e33\u0e04\u0e33\u0e28\u0e31\u0e1e\u0e17\u0e4c):\nUse the clear and simple format below. Use emojis to make it visually appealing.\n\ud83c\udde8\ud83c\uddf3 \u0e04\u0e33\u0e28\u0e31\u0e1e\u0e17\u0e4c\u0e20\u0e32\u0e29\u0e32\u0e08\u0e35\u0e19: [Chinese]\n\ud83d\udde3\ufe0f \u0e1e\u0e34\u0e19\u0e2d\u0e34\u0e19 (Pinyin): [Pinyin]\n\ud83c\uddf9\ud83c\udded \u0e04\u0e27\u0e32\u0e21\u0e2b\u0e21\u0e32\u0e22: [Thai meaning]\n\n3. Real-World Scenarios (\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e2a\u0e16\u0e32\u0e19\u0e01\u0e32\u0e23\u0e13\u0e4c\u0e08\u0e23\u0e34\u0e07):\nProvide at least two different example sentences. Don't just give a dry sentence; frame it as a mini-dialogue or a real-life situation that a Thai person might encounter (e.g., ordering food, shopping, talking with friends, traveling).\nFormat:\nA: [Chinese sentence with the word]\n(Pinyin: [Pinyin for the sentence])\n\ud83c\uddf9\ud83c\udded Thai Translation: [Thai translation of the sentence]\nB: [A possible reply in Chinese]\n(Pinyin: [Pinyin for the reply])\n\ud83c\uddf9\ud83c\udded Thai Translation: [Thai translation of the reply]\n\n4. Pro-Tip / Fun Fact (\u0e40\u0e01\u0e23\u0e47\u0e14\u0e04\u0e27\u0e32\u0e21\u0e23\u0e39\u0e49 / \u0e40\u0e04\u0e25\u0e47\u0e14\u0e25\u0e31\u0e1a):\nGo beyond a simple fun fact. Offer one of the following:\n4.1 Cultural Insight: How is this word used in a cultural context in China?\n4.2 Common Mistake: Point out a common mistake Thai learners make with this word and how to avoid it.\n4.3 Nuance & Usage: Explain the subtle feeling or specific situation where this word is most appropriate compared to a similar word.\n4.4 Word Breakdown: Briefly explain what the individual characters mean, if it helps with memory (e.g., \"The first character means 'electric' and the second means 'brain', so 'computer' is literally 'electric brain'! \ud83e\udde0\u26a1\ufe0f\").\n\n5. Call to Action & Engagement (\u0e0a\u0e27\u0e19\u0e04\u0e38\u0e22 / \u0e1b\u0e34\u0e14\u0e17\u0e49\u0e32\u0e22):\nEnd with an open-ended question to encourage comments. For example: \"\u0e41\u0e25\u0e49\u0e27\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e19\u0e46 \u0e40\u0e04\u0e22\u0e43\u0e0a\u0e49\u0e04\u0e33\u0e19\u0e35\u0e49\u0e43\u0e19\u0e2a\u0e16\u0e32\u0e19\u0e01\u0e32\u0e23\u0e13\u0e4c\u0e44\u0e2b\u0e19\u0e01\u0e31\u0e19\u0e1a\u0e49\u0e32\u0e07? \u0e25\u0e2d\u0e07\u0e41\u0e15\u0e48\u0e07\u0e1b\u0e23\u0e30\u0e42\u0e22\u0e04\u0e21\u0e32\u0e41\u0e0a\u0e23\u0e4c\u0e01\u0e31\u0e19\u0e43\u0e15\u0e49\u0e04\u0e2d\u0e21\u0e40\u0e21\u0e19\u0e15\u0e4c\u0e2b\u0e19\u0e48\u0e2d\u0e22\u0e2a\u0e34\u0e04\u0e30! \ud83d\udc47\" (In what situations have you used this word? Try writing a sentence and share it in the comments! \ud83d\udc47)\n\n6. Hashtags (\u0e41\u0e2e\u0e0a\u0e41\u0e17\u0e47\u0e01):\nInclude a mix of relevant Thai and English hashtags to increase reach.\nExamples: #\u0e40\u0e23\u0e35\u0e22\u0e19\u0e08\u0e35\u0e19 #\u0e20\u0e32\u0e29\u0e32\u0e08\u0e35\u0e19 #\u0e2a\u0e2d\u0e19\u0e08\u0e35\u0e19 #\u0e40\u0e23\u0e35\u0e22\u0e19\u0e20\u0e32\u0e29\u0e32\u0e08\u0e35\u0e19\u0e2d\u0e2d\u0e19\u0e44\u0e25\u0e19\u0e4c #\u0e28\u0e31\u0e1e\u0e17\u0e4c\u0e08\u0e35\u0e19 #Chinese #LearnChinese #\u0e20\u0e32\u0e29\u0e32\u0e08\u0e35\u0e19\u0e27\u0e31\u0e19\u0e25\u0e30\u0e04\u0e33 #HSK\n\n# OUTPUT FORMAT:\nReturn your output as a free text to be posted on social media"
},
"promptType": "define",
"hasOutputParser": true
},
"retryOnFail": true,
"typeVersion": 2
},
{
"id": "bfd51a8d-be3e-4649-b03e-91cedd8f40f3",
"name": "Structured Output Parser2",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1104,
-464
],
"parameters": {
"jsonSchemaExample": "{\n \"image_prompt_brief\": \"YOUR_GENERATED_SENTENCE_HERE\"\n}"
},
"typeVersion": 1.2
},
{
"id": "105e7755-736f-4af6-81d5-09bb0958a5ae",
"name": "Create Image Prompt",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
928,
-592
],
"parameters": {
"text": "={{ $('Code').item.json.input }}",
"options": {
"systemMessage": "=# ROLE:\nYou are a creative concept artist. Your job is to read a social media post and distill its core visual essence into a single, brief sentence.\n\n# INPUT:\nYou will receive an input containing the content of a Facebook post created by the previous agent.\n\n# TASK:\nRead the provided post and generate one brief, descriptive sentence that can be used as a simple prompt for an image generation AI.\n\nYour sentence should:\n1. Capture the main subject, mood, and action of the post.\n2. Be simple, clear, and easy for an image AI to understand.\n3. Do not include technical commands, aspect ratios (--ar), or specific artist names.\n4. Return only 2-3 sentences in plain english word only (no single/doucle quote and any markdown character)\n\n# OUTPUT FORMAT:\nProduce a JSON object with a single key, image_prompt_brief, containing the generated sentence. Try to avoid special characters to the JSON will not error."
},
"promptType": "define",
"hasOutputParser": true
},
"retryOnFail": true,
"typeVersion": 2,
"alwaysOutputData": true
},
{
"id": "0e3364cb-2bc5-4baf-b25b-89e58689fcc9",
"name": "Text Over Image",
"type": "n8n-nodes-base.httpRequest",
"disabled": true,
"position": [
688,
432
],
"parameters": {
"url": "https://api.segmind.com/v1/text-overlay",
"method": "POST",
"options": {
"allowUnauthorizedCerts": true
},
"sendBody": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"bodyParameters": {
"parameters": [
{
"name": "align",
"value": "right"
},
{
"name": "base64",
"value": "false"
},
{
"name": "blend_mode",
"value": "normal"
},
{
"name": "color",
"value": "#FFF"
},
{
"name": "font",
"value": "JosefinSans-Bold"
},
{
"name": "font_size",
"value": "150"
},
{
"name": "graphspace",
"value": "0"
},
{
"name": "image",
"value": "={{ $json.data[0].url }}"
},
{
"name": "image_format",
"value": "jpeg"
},
{
"name": "image_quality",
"value": "90"
},
{
"name": "linespace",
"value": "10"
},
{
"name": "margin_x",
"value": "97"
},
{
"name": "margin_y",
"value": "300"
},
{
"name": "outline_color",
"value": "#11ff00"
},
{
"name": "outline_size",
"value": "0"
},
{
"name": "text",
"value": "={{ $('Get Thai Word').item.json['Thai Word'] }}"
},
{
"name": "text_underlay",
"value": "false"
},
{
"name": "wrap",
"value": "50"
}
]
},
"genericAuthType": "httpHeaderAuth",
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "b46a5f5f-69b2-4f03-8add-0e24aa674ab4",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-656,
-848
],
"parameters": {
"color": 7,
"width": 360,
"height": 640,
"content": "## Sample Post\n\n\n\n\n"
},
"typeVersion": 1
},
{
"id": "875726ce-cc4a-4f14-9c13-884c5c63632f",
"name": "OpenRouter Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
528,
-416
],
"parameters": {
"model": "google/gemini-2.5-pro",
"options": {}
},
"credentials": {
"openRouterApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "ec0bfaa3-9cd0-47d2-8e9b-28f15459c60f",
"name": "OpenRouter Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
912,
-464
],
"parameters": {
"model": "google/gemini-flash-1.5",
"options": {}
},
"credentials": {
"openRouterApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "3a050584-6eca-4142-9cec-995157ad1527",
"name": "Facebook Graph API",
"type": "n8n-nodes-base.facebookGraphApi",
"position": [
1744,
-592
],
"parameters": {
"edge": "photos",
"node": "348151102062182",
"hostUrl": "=graph.facebook.com",
"options": {
"queryParameters": {
"parameter": [
{
"name": "message",
"value": "={{ $('Create FB Post Content').item.json.output }}"
},
{
"name": "url",
"value": "={{ $json.data[0].url }}"
}
]
}
},
"graphApiVersion": "v22.0",
"httpRequestMethod": "POST"
},
"credentials": {
"facebookGraphApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "337a556c-0bd6-47d7-8dc3-47b3752eabf2",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
1632,
-768
],
"parameters": {
"width": 316,
"height": 440,
"content": "## Facebook Post\n\nUse Facebook Graph API to post both text and image in the same post\nhttps://developers.facebook.com/docs/pages-api/posts#publish-a-photo\n"
},
"typeVersion": 1
},
{
"id": "fb1af74d-c403-427a-af21-cb56127e2369",
"name": "When chat message received",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-112,
-592
],
"parameters": {
"options": {}
},
"typeVersion": 1.1
},
{
"id": "01efd89a-f09c-4615-82b0-aa563de782dd",
"name": "Code",
"type": "n8n-nodes-base.code",
"position": [
256,
-592
],
"parameters": {
"jsCode": "// Get the value from chatInput\nconst value = $json.chatInput \n\n// Return the desired structure\nreturn [\n {\n json: {\n word: value,\n input: value\n }\n }\n];"
},
"typeVersion": 2
},
{
"id": "adddd78e-f604-4340-a685-4949460378fa",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-224,
-768
],
"parameters": {
"width": 336,
"height": 336,
"content": "## Input\n\nThe input here is from the chat message below. However, please feel free to replace it with GoogleSheet of plan or Email input or anything that works for you."
},
"typeVersion": 1
},
{
"id": "4b0b09cd-d2fd-4843-99fa-01a4f303d35e",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
144,
-768
],
"parameters": {
"width": 320,
"height": 336,
"content": "## Copy it to words and input\n\nBecause sometimes the route of n8n will delete the content used earlier, we explicitly split it into 2 variables"
},
"typeVersion": 1
},
{
"id": "687332b1-a3bb-442e-8c11-1efeafb18e2c",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
496,
-768
],
"parameters": {
"color": 4,
"width": 320,
"height": 512,
"content": "## Generate Text\n\nUse Openrouter.ai to write the content for Facebook from the input word we've got"
},
"typeVersion": 1
},
{
"id": "5af9aebe-723d-413b-b01b-e1a20b386af0",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
880,
-768
],
"parameters": {
"color": 6,
"width": 336,
"height": 512,
"content": "## Describe Image\n\nUse AI to describe the words so that we can use this as input to generate image. We make sure it structured so that the API call will not break."
},
"typeVersion": 1
},
{
"id": "3949bee3-2eb7-4044-afc1-116cd05c40d7",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
1232,
-768
],
"parameters": {
"color": 6,
"width": 336,
"height": 512,
"content": "## Generate Image\n\nUsing Recraft.ai with specified styled to make sure we have consistent image theme."
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "4c01b471-6ed8-4c13-893f-d597f6702642",
"connections": {
"Code": {
"main": [
[
{
"node": "Create FB Post Content",
"type": "main",
"index": 0
}
]
]
},
"Text Over Image": {
"main": [
[]
]
},
"Facebook Graph API": {
"main": [
[]
]
},
"Create Image Prompt": {
"main": [
[
{
"node": "Generate Image (Recraft.ai)",
"type": "main",
"index": 0
}
]
]
},
"OpenRouter Chat Model": {
"ai_languageModel": [
[
{
"node": "Create FB Post Content",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Create FB Post Content": {
"main": [
[
{
"node": "Create Image Prompt",
"type": "main",
"index": 0
}
]
]
},
"OpenRouter Chat Model1": {
"ai_languageModel": [
[
{
"node": "Create Image Prompt",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structured Output Parser2": {
"ai_outputParser": [
[
{
"node": "Create Image Prompt",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Generate Image (Recraft.ai)": {
"main": [
[
{
"node": "Facebook Graph API",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
facebookGraphApihttpHeaderAuthopenRouterApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
How this works
Effortlessly generate and publish engaging Facebook posts by simply chatting with an AI assistant, saving hours of manual content creation and design work for busy social media managers and small business owners. This workflow transforms a casual conversation into polished visuals and captions, leveraging integrations like Recraft.ai for image generation and Facebook Graph API for seamless posting. The key step involves an AI agent crafting tailored post content from your input, followed by structuring and overlaying text on custom-generated images to create ready-to-share assets.
Use this workflow when you need quick, AI-powered social media updates without design expertise, such as promoting weekly offers or sharing blog snippets via chat prompts. Avoid it for high-volume posting that requires strict compliance checks, like regulated industries, or when custom analytics are essential beyond basic scheduling. Common variations include adapting the chat trigger for Slack inputs or swapping Recraft.ai for DALL-E to match brand aesthetics.
About this workflow
Facebook Post Automation. Uses httpRequest, agent, outputParserStructured, stickyNote. Chat trigger; 17 nodes.
Source: https://github.com/ScraperNode/awesome-n8n-templates/blob/main/templates/ai-and-llm/7533-automate-chinese-language-teaching-posts-on-facebook-with-gemini-recraftai/workflow.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This comprehensive workflow automates the complete financial document processing pipeline using AI. Upload invoices via chat, drop expense receipts into a folder, or add bank statements - the system a
Turn any YouTube channel into a searchable knowledge base. The AI agent understands relationships between videos, topics, tools, and concepts - enabling powerful queries like "Which videos talk about
⚠️ Important: This workflow uses community nodes (JsonCut, Blotato) and requires a self-hosted n8n instance.
[](https://youtu.be/D11S0s3PDNc)
💰 Beginner Investor – Learn the market faster with AI-powered insights guiding your decisions. 📈 Retail Trader – Optimize your trading strategy with in-depth analysis typically reserved for profession