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
Automate social media posts with n8n and AI

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

Learn how to Build this Workflow with AI:

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.


Automate social media posts with n8n and AI

Visit through Desktop to Interact with the Workflow.

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 Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.