Automated Social Media Content Publishing with n8n & AI

Discover how this unique n8n workflow automates social media content creation and publishing across multiple platforms. It leverages AI-driven prompts and schema parsing to tailor posts for X (Twitter), Instagram, Facebook, LinkedIn, Threads, and YouTube Shorts, saving hours of manual work and ensuring platform-optimized engagement.
chatTrigger
toolWorkflow
googleDocs
+10
Workflow Identifier: 1004
NODES in Use: chatTrigger, stickyNote, toolWorkflow, googleDocs, code, agent, httpRequest, gmail, facebookGraphApi, twitter, linkedIn, facebookGraphApi, executeWorkflowTrigger

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this workflow does

This workflow makes social media posting faster and easier. It solves the problem of spending hours making posts for many channels by using AI to write and create posts automatically. The result is fast, consistent posts ready for different social platforms with pictures and proper style.

It helps create posts for X, Instagram, Facebook, LinkedIn, Threads, and YouTube Shorts. It follows specific rules for each platform and uploads posts with images after approval. The workflow also keeps a copy of each post saved for later use.


Who should use this workflow

This automation is good for social media managers who need to post on many platforms daily. It helps those who want to save time and avoid mistakes in formatting or hashtags.

Users who want to control content quality with approval steps will also find it helpful. Beginners and experienced users of n8n who want to automate repetitive social media tasks benefit from this workflow.


Tools and services used

  • LangChain AI Tool Workflows: For AI content creation tailored by platform.
  • Google Docs: Stores JSON schemas and system prompts as XML formatted documents.
  • pollinations.ai API: Generates suggested images for social posts.
  • imgbb.com API: Hosts generated images for use in social posts.
  • Social Media APIs: Includes X (Twitter) OAuth2, Facebook Graph API, LinkedIn OAuth2 for posting.
  • Gmail API with OAuth2: Sends emails requesting content approval.
  • Google Drive: Saves generated JSON post data centrally.
  • n8n automation platform: Runs the workflow with nodes connected in sequence.

Inputs, processing steps, and outputs

Inputs

  • User sends a chat prompt through When chat message received node.
  • Google Docs URLs provide schemas and system prompts for platforms.

Processing steps

  • Parse XML content from Google Docs to get JSON schemas and prompts.
  • Combine user prompt and platform rules into one AI prompt.
  • Use LangChain Agent to generate posts matching platform formats.
  • Create images with pollinations.ai based on post content.
  • Upload images to imgbb.com and link them in posts.
  • Send approval request emails via Gmail with generated content.
  • Wait to confirm double approval before posting.
  • Route approved posts to correct social media APIs.
  • Save post JSON data into Google Drive for records.

Outputs

  • Fully formed social media posts with formatted text, hashtags, images, and CTAs.
  • Posts published automatically on X, Instagram, Facebook, LinkedIn, Threads, and YouTube Shorts.
  • Approval emails sent and logged.
  • Stored post data ready for analytics or reposting.

Beginner step-by-step: How to use this workflow in n8n

Importing the workflow

  1. Download the workflow file using the Download button on this page.
  2. Open your n8n editor where you manage workflows.
  3. Use the “Import from File” feature in n8n to load the downloaded workflow.

Configuring credentials and settings

  1. Add API Keys or OAuth2 credentials for OpenAI, social media platforms (X, Facebook, LinkedIn), Gmail, imgbb.com, and pollinations.ai.
  2. Update Google Docs URLs in nodes for the social media schemas and prompts, if needed.
  3. Change IDs, email addresses, email recipient lists, social media page IDs, or Google Drive folders as necessary to match your accounts.
  4. Check code and prompt nodes for exact values to paste as needed, like prompt templates or schema parsing functions.

Testing

  1. Trigger the workflow once by sending a chat message matching the input pattern to verify it runs as expected.
  2. Check the content generated, approval email sent, and preview the social posts.

Activating for production

  1. Once testing is successful, activate the workflow in n8n to run automatically when chat messages arrive.
  2. Make sure the webhook URLs for the chat trigger are publicly accessible.
  3. Monitor logs for any errors and update credentials if tokens expire.
  4. Consider using self-host n8n if needed for stable operation.

Common issues and how to solve

  • Workflow does not start when chat prompt is sent: Check that When chat message received node webhook URL matches in LangChain chat app. Test with curl or test prompt.
  • JSON schema parsing errors: Verify Google Docs have correct XML tags and well-formed JSON. Review parse nodes for match.
  • Image generation fails or returns no image: Confirm pollinations.ai API key validity and network access. Retry or change image API if needed.
  • Posts fail to publish: Check all social media API credentials, ensure tokens are valid and have posting rights.

Customization ideas

  • Update Google Docs schemas or prompt files for changes in platform requirements or hashtags.
  • Replace pollinations.ai with another image API by changing the HTTP Request node URL and parameters.
  • Switch AI model in LangChain nodes to another OpenAI model like GPT-4o or GPT-4o-mini for style changes.
  • Add more approval email recipients or adjust response times by modifying the Gmail nodes.
  • Add new social media platforms by creating LangChain workflows and API nodes in the publishing router.

Summary of results

✓ Saves 4-5 hours daily by automating content creation and posting.

✓ Ensures posts fit each social platform’s style and technical rules.

✓ Generates and hosts images automatically for posts.

✓ Adds a controlled approval process before posting.

✓ Keeps all posts organized and stored in Google Drive.

→ Gives users more time and less worry over posting errors.

→ Removes manual steps for better productivity and consistency.


Frequently Asked Questions

The workflow uses LangChain AI Tool Workflows with system prompts and JSON schemas to generate posts for each platform automatically.
The workflow starts when a chat message is received through the Webhook node configured for LangChain chat input.
pollinations.ai API creates image suggestions, which the workflow uploads to imgbb.com. The image URLs are then linked in the social posts.
Yes, the Gmail node settings can be updated to add more approvers or change how approval responses are handled.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free