Automated Social Media Publishing with n8n and AI Agents

This workflow automates tailored social media content creation and publishing across multiple platforms using n8n’s Langchain AI nodes and integration with Google Docs, image generation, and platform APIs. It streamlines content creation, approval, and multi-channel distribution to save time and ensure consistency.
chatTrigger
agent
googleDrive
+16
Workflow Identifier: 1001
NODES in Use: chatTrigger, stickyNote, toolWorkflow, code, googleDocs, agent, httpRequest, googleDrive, gmail, facebookGraphApi, twitter, linkedIn, telegram, switch, set, extractFromFile, if, merge, noOp
Automate social media with n8n and AI agents

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

Learn how to Build this Workflow with AI:

What This Workflow Does

This workflow takes a simple message and makes a ready social media post for many platforms.

It solves the problem of making unique posts and images for each platform by itself.

The result is posts with matching images that are sent for review and then posted automatically.


Who Should Use This Workflow

This is for people working with content on Twitter (X), Instagram, Facebook, LinkedIn, Threads, and YouTube Shorts.

Users want to save time and keep messages and images clear and on-brand for each platform.

Teams needing approval steps and archives find it useful too.


Tools and Services Used


Workflow Inputs, , and Outputs

Input

A user sends a short prompt message through a chat message trigger node in n8n.

Steps

  1. Fetch system prompt and social media JSON schema from Google Docs nodes.
  2. Parse the prompt and schema XML content into clear JSON objects using code nodes.
  3. Merge prompts and schema to build a structured input for AI generation nodes.
  4. Generate platform-specific content using Langchain AI nodes powered by OpenAI.
  5. Request a matching image from Pollinations.ai based on the AI-suggested concept.
  6. Save the image to Google Drive and imgbb.com for storage and backup.
  7. Combine post content and image data for final payload.
  8. Route the payload to respective social platform publishing nodes.
  9. Send an approval email via Gmail node to get user confirmation before posting.
  10. Check approval response and continue if allowed.
  11. Archive the final posts and images again in Google Drive.
  12. Optionally send notifications to Telegram channel.

Output

The published social media posts appear on each platform with matching images and are stored in cloud storage archives.

Teams get notified of status and any errors through email or Telegram.


Beginner Step-by-Step: How to Use This Workflow in n8n

1. Importing the Workflow

  1. Download the workflow file by clicking the Download button on this page.
  2. Inside the n8n editor, click the menu and choose Import from File.
  3. Select the downloaded workflow JSON file to load it.

2. Configuring Credentials and IDs

  1. Add or update API Keys and OAuth credentials for OpenAI, Pollinations.ai, Google Drive, Gmail, and social media platforms.
  2. Set the Google Docs document IDs for Social Media System Prompt and Social Media Schema nodes.
  3. Update email addresses in the approval process if needed.
  4. Check folders and channels in Google Drive and Telegram nodes.

3. Testing the Workflow

  1. Send a test message to the chat message trigger to start the workflow.
  2. Check logs and outputs in n8n to ensure AI content and images generate correctly.
  3. Verify that the approval email is received and that responding approves or rejects the posting.
  4. Check social media accounts for the published post.

4. Activating for Production

  1. Turn the workflow status to active in n8n.
  2. Ensure all credentials are valid and refreshing properly.
  3. Start using chat messages to produce posts automatically as needed.

Remember to consult self-host n8n if running a private workflow server.


Troubleshooting Common Issues

  • Trigger Not Starting: Check the webhook ID and link in the chat message trigger node.
  • Parsing Errors in Schema: Verify that Google Docs content is valid JSON; use JSON lint tools.
  • Image Generation Fails: Make sure Pollinations.ai API Key is correct and endpoint is stable.
  • Posts Not Publishing: Review OAuth permissions and renew tokens for social APIs.

Customization Ideas

  • Add more social platforms by copying router and publishing nodes and updating schema documents.
  • Change the image AI service by editing the HTTP Request node’s URL and parameters.
  • Adjust approval process timings or add multiple approvers in the Gmail approval node.
  • Edit external Google Docs prompts to change brand voice or update content style rules.
  • Update hashtags or trending topics in the social media schema document.

Summary of Results

✓ Saves many hours writing and scheduling posts for multiple platforms.

✓ Ensures each post matches platform rules and style for best impact.

✓ Uses AI to create both text and images that fit together.

✓ Adds an email approval step to avoid posting mistakes.

✓ Keeps archives in Google Drive for record and reuse.

→ Automates social media posting from a single prompt, making teamwork easier and faster.


Automate social media with n8n and AI agents

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The Social Media Content Creator uses Langchain agents with OpenAI models. It takes merged prompts and schemas to generate JSON posts fitting the platform’s style and format.
Check the external Google Docs for valid JSON content. Use JSON lint tools to fix format issues before retrying the workflow.
Open each node needing credentials like OpenAI, Pollinations.ai, or Google API, and enter new API Key values or OAuth credentials. Save changes before running workflow again.
Yes. The workflow supports expandability. Users can add nodes and update prompt schemas to add platforms like TikTok or Pinterest.

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.