Category: Automations › Social Media & Content · Best for: Brands posting on many platforms · Platform: n8n · Steps: 57
What it does
The AI writes and posts content to all your social media accounts.
Adjust parameters and content for each platform to suit your needs.
Works with: Memory Buffer Window, OpenAI, Tool Workflow, Tool Serp Api, Google Docs, Agent, Gmail, Google Drive, Telegram, Twitter, WhatsApp Cloud API, Facebook, LinkedIn
What you get
- The n8n workflow file (
workflow.json), ready to import - This setup guide
- The list of fields to change for your own accounts (see Install below)
- Email support if you get stuck
Before you start
-
An n8n account. Easiest: n8n Cloud (free trial). Self-host for free with Docker:
docker run -it --rm -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n, then open http://localhost:5678. -
Accounts and API keys for these services:
- Google (Sheets, Gmail, Drive, Calendar, Docs): how to connect (used by Gmail, Social Media Schema, Social Media System Prompt, Gmail User for Approval, Save Image to Google Drive, Save Social Post to Google Drive, Get Social Post from Google Drive)
- OpenAI API key: how to connect (used by gpt-40-mini, gpt-40-mini1, gpt-4o-mini, gpt-4o)
- Meta / Facebook Graph API: how to connect (used by Instagram Image, Instragram Post, Facebook Post)
- X (Twitter) developer app: how to connect (used by X Post)
- LinkedIn app: how to connect (used by LinkedIn Post)
- Telegram bot token from @BotFather: how to connect (used by Telegram Success Message (Optional), Telegram Error Message (Optional))
- serpApi: how to connect (used by SerpAPI)
Install
- In n8n, click Create workflow (top right).
- Click the ⋯ menu → Import from file and choose
workflow.json. Or open the file, copy everything and paste it onto the empty canvas with Ctrl/Cmd + V. - Open each node with a red warning triangle and pick or create the matching credential from the list above.
- Point these fields at your own sheets, chats and accounts:
- Gmail →
sendTo: choose your own - Gmail User for Approval →
sendTo: choose your own - Save Image to Google Drive →
driveId: choose your own - Save Image to Google Drive →
folderId: choose your own - Save Social Post to Google Drive →
driveId: choose your own - Save Social Post to Google Drive →
folderId: choose your own - Telegram Success Message (Optional) →
chatId: choose your own - Telegram Error Message (Optional) →
chatId: choose your own
- Gmail →
- Click Save.
Test it
- Click Test workflow (or Execute workflow). When Executed by Another Workflow starts it. Trigger it once with real sample data.
- Click each node to check its output. A green tick means the step worked.
- Fix any red node: it's almost always a credential or a field that still points at a sheet or chat that isn't yours.
Go live
Toggle Active (top right). From now on it runs on its own. Check Executions in the left sidebar to see every run.
How it works, step by step
- When Executed by Another Workflow starts the workflow (Execute Workflow).
- When chat message received starts the workflow (Chat).
- Window Buffer Memory uses AI (Memory Buffer Window).
- gpt-4o uses AI (OpenAI).
- X-Twiter uses AI (Tool Workflow).
- Instagram uses AI (Tool Workflow).
- Short uses AI (Tool Workflow).
- Facebook uses AI (Tool Workflow).
- YouTube Short uses AI (Tool Workflow).
- LinkedIn uses AI (Tool Workflow).
- gpt-4o-mini uses AI (OpenAI).
- gpt-40-mini1 uses AI (OpenAI).
- SerpAPI uses AI (Tool Serp Api).
- gpt-40-mini uses AI (OpenAI).
- Social Media System Prompt uses Google Docs to get.
- Social Media Schema uses Google Docs to get.
- Merge Prompts and Schema uses Merge.
- Social Media Router Agent uses AI (Agent).
- Social Media Content Creator uses AI (Agent).
- Prepare Email Contents uses AI (Agent).
- Prepare Social Media Email Contents uses AI (Agent).
- System Prompt reshapes the data for the next step.
- Schema reshapes the data for the next step.
- Compose Prompt & Schema reshapes the data for the next step.
- File Id reshapes the data for the next step.
- Social Content reshapes the data for the next step.
- Gmail User for Approval uses Gmail to sendAndWait.
- Gmail uses Gmail.
- Parse System Prompt reshapes the data for the next step.
- Parse Schema reshapes the data for the next step.
- Get Social Post from Google Drive uses Google Drive to download.
- pollinations.ai1 calls an external API (=https://image.pollinations.ai/prompt/{{ $json.output.common).
- Is Approved? checks a condition and routes items accordingly.
- Extract as JSON uses Extract From File to fromJson.
- Telegram Success Message (Optional) uses Telegram.
- Save Image to imgbb.com calls an external API (https://api.imgbb.com/1/upload).
- Save Image to Google Drive uses Google Drive.
- Merge uses Merge.
- Telegram Error Message (Optional) uses Telegram.
- Get Social Post Image calls an external API (={{ $('Extract as JSON').item.json.data.social_image.medium.).
- Merge Image and Post Contents uses Merge.
- Google Drive Image Meta reshapes the data for the next step.
- Social Media Publishing Router checks a condition and routes items accordingly.
- Social Post JSON reshapes the data for the next step.
- X Post uses Twitter.
- Instagram Image calls an external API (https://graph.facebook.com/v20.0/[your-unique-id]/media).
- Facebook Post uses Facebook.
- LinkedIn Post uses LinkedIn.
- Implement Threads Here uses No Op.
- Implement YouTube Shorts Here uses No Op.
- Save Social Post to Google Drive uses Google Drive to createFromText.
- X Response reshapes the data for the next step.
- Instragram Post uses Facebook.
- Facebook Response reshapes the data for the next step.
- LinkedIn Response reshapes the data for the next step.
- Respond with Google Drive Id reshapes the data for the next step.
- Instagram Response reshapes the data for the next step.
Extra setup notes
These notes are also on the canvas as yellow sticky notes:
LLM
Chat Memory
Start Here
Social Media Publishing Router
1⃣ X - Twitter
2⃣ Instagram
3⃣ Facebook
4⃣ LinkedIn
5⃣Threads
6⃣YouTube Shorts
Social Media Agent Tools
Social Media Content Factory
Create Post Image
https://pollinations.ai/ https://image.pollinations.ai/prompt/[your image description]
Notes
Update all Social Media Platform Credentials as required.
Adjust parameters and content for each platform to suit your needs.
Approve Content Before Proceeding
Prompt & Schema Composition from External Sources
<system> You are a specialized content creation AI for social media platforms. Your primary function is generating platform-optimized social media content across various platforms including LinkedIn, Instagram, Facebook, Twitter (X), Threads, and YouTube Shorts. Each piece of content must: Match the specific platform's audience expectations and algorithm preferences Showcase relevant expertise in your field Deliver actionable insights for your target audience Drive meaningful engagement through value-driven content OBJECTIVES: Create platform-specific content following each platform's best practices Implement strategic hashtag usage combining general and trending tags Design content that encourages user interaction and community building Maintain consistent brand voice while adapting to platform requirements Incorporate data-driven insights to maximize content performance OUTPUT REQUIREMENTS: Deliver content in valid JSON format according to the platform-specific schema Include all required fields as specified in the schema Omit any explanatory text or code fencing in your response Tailor content specifically to the platform indicated in the user's request For each content request, adapt your output based on the platform guidelines. Never provide URLS for video or image suggestions and only describe the suggestion. </system> <rules> Only provide final response in valid JSON for the appropriate social platform Never include any preamble or further explanation Always remove any ``` ```json </rules> <linkedin> **Style**: Professional and insightful. **Tone**: Business-oriented; focus on automation use cases, industry insights, and community impact. **Content Length**: 3-4 sentences; concise but detailed. **Hashtags**: #Innovation #Automation #WorkflowSolutions #DigitalTransformation #Leadership **Call to Action (CTA)**: Encourage comments or visits to workflows.diy's website for more insights. </linkedin> <instagram> **Style**: Visual storytelling with creative captions. **Tone**: Inspirational and engaging; use emojis for relatability. **Content Length**: 2-3 sentences paired with eye-catching visuals (e.g., infographics or workflow demos). **Visuals**: Showcase milestones (e.g., new workflow launches), tutorials, or product highlights. **CTA**: Use phrases like "Swipe to learn more," "Tag your team," or "Check out the link below!" **Link Placement**: Add the provided link before hashtags; if no link is provided, use "Visit our website: https://example.com" **Hashtags**: #AutomationLife #TechInnovation #WorkflowTips #Programming #Engineering </instagram> <facebook> **Style**: Friendly and community-focused. **Tone**: Relatable; highlight user success stories or company achievements in automation. **Content Length**: 2-3 sentences; conversational yet professional. **Hashtags**: #SmallBusinessAutomation #Entrepreneurship #Leadership #WorkflowInnovation **CTA**: Encourage likes, shares, comments (e.g., "What's your favorite automation tip?"). </facebook> <xtwitter> **Style**: Concise and impactful. **Tone**: Crisp and engaging; spark curiosity in 150 characters or less. **Hashtags**: #WorkflowTrends #AIWorkflows #AutomationTips #NoCodeSolutions **CTA**: Drive quick engagement through retweets or replies (e.g., "What's your go-to n8n workflow?"). </xtwitter> <threads> **Style**: Conversational and community-driven posts. **Tone**: Casual yet informative; encourage discussions around automation trends or innovations. **Content Length**: 1-2 short paragraphs with a question or thought-provoking statement at the end. **Hashtags**: Similar to Instagram but tailored for trending Threads topics related to automation. </threads><youtube_short> Style: Short-form video content showcasing quick workflow tutorials or use cases. Tone: Authoritative yet approachable; establish workflows.diy as a leader in n8n automation solutions. Content Length: Tutorials/Reviews (long-form): 5-10 minutes Shorts/Highlights (short-form): Under 1 minute
</youtube_short>
<common> { "type": "object", "properties": { "hashtags": { "type": "array", "items": { "type": "string" } }, "image_suggestion": { "type": "string" } } } </common> <root> { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "additional_notes": { "type": "string" } } } </root> <linkedin> { "type": "object", "properties": { "post": { "type": "string" }, "call_to_action": { "type": "string" } } } </linkedin> <instagram> { "type": "object", "properties": { "caption": { "type": "string" }, "emojis": { "type": "array", "items": { "type": "string" } }, "call_to_action": { "type": "string" } } } </instagram> <facebook> { "type": "object", "properties": { "post": { "type": "string" }, "call_to_action": { "type": "string" } } } </facebook> <xtwitter> { "type": "object", "properties": { "video_suggestion": { "type": "string" }, "post": { "type": "string" }, "character_limit": { "type": "integer" } } } </xtwitter> <threads> { "type": "object", "properties": { "text_post": { "type": "string" }, "call_to_action": { "type": "string" } } } </threads><youtube_short> { "type": "object", "properties": { "video_suggestion": { "type": "string" }, "title": { "type": "string" }, "description": { "type": "string" }, "call_to_action": { "type": "string" } } } </youtube_short>
System Prompt
Social Media Schema
External System Prompt and Schema
Publish to Social Media
Social Media Content Creator
Send Social Media Image and Post Contents to Gmail
(optional)
Prepare Social Media Post and Save to Google Drive
Social Media Schema
System Prompt
Social Media Router Agent
Prepare Email Approval Contents as HTML
Features & Benefits
1⃣System Prompt Composition from External Source
Centralized prompt management: Store and update system prompts in Google Docs for easy team collaboration
-
Consistent brand voice: Ensure all generated content maintains consistent tone and style across platforms
-
Flexible customization: Quickly modify prompts without changing workflow code
-
Version control: Track changes to prompts over time with Google Docs revision history
-
Role-specific access: Control who can edit core prompts while allowing broader viewing access
2⃣Output Schema Composition from External Source
-
Structured content generation: Enforce consistent JSON output formats for each platform
-
Platform-specific optimization: Tailor content structure to each social network's requirements
-
Reduced errors: Validate content against schemas before publishing
-
Easy updates: Modify schemas as platform requirements change without workflow modifications
-
Standardized metadata: Ensure all required fields are included for each platform
4⃣ Dynamic Social Media Content Creator Agent with Web Search Tool to Match Social Post and Platform Schema
-
Real-time research: Incorporate current events and trending topics into content
-
Fact-checking: Verify information before publishing to maintain credibility
-
Competitive analysis: Reference industry trends and competitor content
-
Contextual relevance: Create content that responds to current market conditions
-
Enhanced engagement: Generate content that aligns with trending conversations
5⃣ Dynamic Image Creation to Match Social Post & Platform Schema
-
Visual consistency: Generate platform-optimized images that match content themes
-
Automated alt text: Create accessibility-compliant image descriptions
-
Multi-format output: Generate images in various dimensions for different platforms
-
Brand compliance: Ensure all visuals align with brand guidelines
-
Reduced design bottlenecks: Eliminate waiting for custom graphics for each post
6⃣ Image Archiving to Multiple Cloud Services for Future Use
- Redundant storage: Prevent content loss with multi-location backups
-Searchable repository: Build a library of past content for reference and reuse
-
Asset tracking: Maintain records of which images were used for which campaigns
-
Compliance documentation: Keep records of published content for regulatory purposes
-
Resource optimization: Reuse successful visual assets for future campaigns
7⃣ Telegram Messaging for Workflow Status
-
Real-time notifications: Get immediate alerts about workflow execution
-
Error tracking: Quickly identify and address failures in the content pipeline
-
Team coordination: Keep stakeholders informed of content progress
-
Audit trail: Maintain records of when content was created and published
-
Remote monitoring: Track workflow execution from mobile devices
8⃣ Optional Workflow Reporting to Gmail in with Structured HTML Content
-
Executive summaries: Provide management with clean, formatted reports
-
Content approval: Enable stakeholders to review content before publishing
-
Performance tracking: Document content metrics in standardized formats
-
Schedule adherence: Monitor if content is being published according to plan
-
Resource allocation: Track time and effort spent on different content types
9⃣ Social Post Archiving to Google Drive for Future Use
-
Content library: Build a searchable repository of all published content
-
Performance correlation: Connect content with its performance metrics
-
Compliance records: Maintain documentation of published materials
-
Content repurposing: Easily find and adapt past successful content
-
Campaign documentation: Group related content for campaign analysis
3⃣Dynamic System Prompt and Platform Schema Composition based on User Prompt using External Sources
-
Centralized prompt management: Store all system prompts in a single external source for easier maintenance and updates
-
Platform-specific optimization: Automatically tailor content to each platform's unique requirements and audience expectations
-
Consistent brand voice: Ensure all generated content maintains your brand's tone and messaging guidelines across platforms
-
Reduced technical debt: Modify prompts and schemas without changing workflow code or redeploying applications
-
Collaborative improvement: Enable marketing teams to refine prompts without developer intervention
-
Version control: Track changes to prompts and schemas over time with document revision history
-
A/B testing capability: Easily test different prompt variations to optimize content performance
-
Scalable content strategy: Add support for new platforms by simply creating new prompt and schema documents
-
Dynamic adaptation: Respond to platform algorithm changes by quickly updating external prompt documents
-
Knowledge preservation: Maintain institutional knowledge about effective platform-specific content strategies
-
Reduced onboarding time: New team members can understand content requirements by reviewing documented prompts
-
Compliance management: Ensure all generated content follows legal and brand guidelines by centralizing rules
Notes
-
Create Google Doc for the Social Media Schema and copy the provided schema.
-
Update the Google Doc ID in the Social Media Schema node.
-
Create Google Doc for the Social Media System Prompt and copy the provided System Prompt.
-
Update the Google Doc ID in the Social Media System Prompt node.
Adjust system prompt and platform specific prompts to suit your needs.
Notes
Replace pollinations.ai with any online image generation service that produces an image file you can download.
Notes
Replace Chat model with other LLMs and test out the results. Add more tools or try other web search tools to suit your use case.
Troubleshooting
- "Credentials not found": open the node and select your credential again.
- Google "access blocked": in Google Cloud, add your email as a test user on the OAuth consent screen.
- Webhook not firing: copy the node's Production URL (not Test URL) into the other app, and make sure the workflow is Active.
- AI node errors: check your API key has billing enabled and the model name exists on your plan.
- Nothing happens on schedule: the workflow must be Active, and self-hosted n8n must stay running.
Need help?
Reply to your Morning Method order email and we'll help you get it running.
© Morning Method