This workflow corresponds to n8n.io template #3082 — we link there as the canonical source.
This workflow follows the Agent → Form 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": "wyzRJoRGTlwmZ0JJ",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Social Media Content Generator And Publisher | X, Linkedin",
"tags": [],
"nodes": [
{
"id": "7095690e-4f33-4ad0-8276-f5f91768bc42",
"name": "Google Gemini Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
200,
220
],
"parameters": {
"options": {},
"modelName": "models/gemini-2.0-flash"
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "2858290a-82be-4f2f-9f20-a1147d1feb32",
"name": "Receive Post Title",
"type": "n8n-nodes-base.formTrigger",
"position": [
0,
0
],
"parameters": {
"options": {},
"formTitle": "post",
"formFields": {
"values": [
{
"fieldLabel": "post title"
}
]
},
"authentication": "basicAuth",
"formDescription": "post"
},
"credentials": {
"httpBasicAuth": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
},
{
"id": "b1540464-46ca-42d3-9e53-c3b7bd006d55",
"name": "Generate AI Content",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
200,
0
],
"parameters": {
"text": "=\nwrite min 50 word about this topic '{{ $json[\"post title\"] }}'\nfor Linkedin and X platform separately",
"options": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.7
},
{
"id": "ac86de4e-49a2-4efc-9067-bbb0008a218c",
"name": "Format AI Output",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
360,
260
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"event_name\": {\n \"type\": \"string\"\n },\n \"event_description\": {\n \"type\": \"string\"\n },\n \"platform_posts\": {\n \"type\": \"object\",\n \"properties\": {\n \"LinkedIn\": {\n \"type\": \"object\",\n \"properties\": {\n \"post\": {\n \"type\": \"string\"\n },\n \"hashtags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"call_to_action\": {\n \"type\": \"string\"\n }\n }\n },\n \"Twitter\": {\n \"type\": \"object\",\n \"properties\": {\n \"post\": {\n \"type\": \"string\"\n },\n \"hashtags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"character_limit\": {\n \"type\": \"integer\"\n }\n }\n }\n }\n },\n \"additional_notes\": {\n \"type\": \"string\"\n }\n }\n}"
},
"typeVersion": 1.2
},
{
"id": "5a4cbb6f-4efc-4fd1-85ea-9022d6415811",
"name": "Post to X",
"type": "n8n-nodes-base.twitter",
"position": [
580,
-100
],
"parameters": {
"text": "={{ $json.output.platform_posts.Twitter.post }}",
"additionalFields": {}
},
"credentials": {
"twitterOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2
},
{
"id": "6be0a393-1ef8-4e2e-b58e-e7dd90bf5295",
"name": "Post to LinkedIn",
"type": "n8n-nodes-base.linkedIn",
"position": [
580,
120
],
"parameters": {
"text": "={{ $json.output.platform_posts.LinkedIn.post }}",
"person": "-HtNhNKSsE",
"additionalFields": {}
},
"credentials": {
"linkedInOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "10336b6e-b093-473c-b8d1-90d6b7b043b3",
"name": "Append Linkedin And X Publishing Responses",
"type": "n8n-nodes-base.merge",
"position": [
860,
20
],
"parameters": {
"mode": "combine",
"options": {},
"combineBy": "combineAll"
},
"typeVersion": 3
},
{
"id": "a236d6ba-0ded-4d42-99a3-0b53069faec5",
"name": "Show Confirmation",
"type": "n8n-nodes-base.form",
"position": [
1080,
20
],
"parameters": {
"options": {},
"operation": "completion",
"completionTitle": "Your post has been successfully shared",
"completionMessage": "=\ud83d\udd17 View your posts:\n\nX (Twitter): \n[https://x.com/x/status/{{ $json.id }}]\n\nLinkedIn:\n[https://www.linkedin.com/feed/update/{{ $json.urn }}]"
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "7b92c25a-8617-44c8-b3b6-c038f01d6bfa",
"connections": {
"Post to X": {
"main": [
[
{
"node": "Append Linkedin And X Publishing Responses",
"type": "main",
"index": 0
}
]
]
},
"Format AI Output": {
"ai_outputParser": [
[
{
"node": "Generate AI Content",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Post to LinkedIn": {
"main": [
[
{
"node": "Append Linkedin And X Publishing Responses",
"type": "main",
"index": 1
}
]
]
},
"Receive Post Title": {
"main": [
[
{
"node": "Generate AI Content",
"type": "main",
"index": 0
}
]
]
},
"Generate AI Content": {
"main": [
[
{
"node": "Post to X",
"type": "main",
"index": 0
},
{
"node": "Post to LinkedIn",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "Generate AI Content",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Append Linkedin And X Publishing Responses": {
"main": [
[
{
"node": "Show Confirmation",
"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.
googlePalmApihttpBasicAuthlinkedInOAuth2ApitwitterOAuth2Api
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This n8n workflow automates the generation and publishing of AI-powered social media content across LinkedIn and X (formerly Twitter). By leveraging AI, this workflow helps social media managers, marketers, and content creators streamline their posting process. Social media…
Source: https://n8n.io/workflows/3082/ — 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.
How it works: This end-to-end workflow automates your personal or brand content strategy by: 🧠 Using Google Gemini or OpenAI to generate engaging LinkedIn/X content from a title or trending posts. 🗓️
Automatically generate SEO-optimized YouTube Titles, Descriptions, Tags & Hashtags – enriched with blog articles, affiliate links, and product recommendations!
This workflow automates content syndication and posting to LinkedIn and X/Twitter. It takes existing long-form articles and generates from them engaging social posts optimized for each platform.
This template is perfect for content creators, marketers, solopreneurs, agencies, and social media strategists who want to understand what audiences are talking about online. It helps teams quickly tu
Summary