n8n

How to Automate Chat-to-Social Publishing with Image Gen and Gmail Previews?

Create and publish social posts from a single chat prompt. Copy, images, and channel formatting are prepared for review and then posted to X, Instagram, Facebook, LinkedIn, Threads, and YouTube Shorts. Built for marketing teams that want speed with control.

Messages start at a chat input with memory, so context carries across replies. The flow pulls a system prompt and a content schema from Google Docs, then uses OpenAI to draft platform specific text. It generates an image with Pollinations AI and hosts it on ImgBB. A Gmail approval email is assembled with channel previews. Once approved, routing tools send the content to each platform through their APIs.

Setup uses OAuth for Gmail, Google Docs, Twitter, Facebook Graph for Instagram and Facebook, and LinkedIn, plus an OpenAI key. Add your Google Doc IDs, brand rules, and image settings. Expect content prep to drop from hours to minutes, with consistent voice, clear approvals, and less rework for social teams.

What are the key features?

  • Chat message trigger with memory to keep context across prompts
  • Loads a system prompt and schema from Google Docs and parses them
  • Generates platform specific copy using OpenAI models
  • Creates a campaign image with Pollinations AI and hosts it on ImgBB
  • Builds an approval email in Gmail with previews for each channel
  • Routes content to X, Instagram, Facebook, LinkedIn, Threads, and Shorts via tool workflows
  • Posts directly using Twitter, Facebook Graph, and LinkedIn APIs
  • Can be called by other workflows through an Execute Workflow trigger

What are the benefits?

  • Reduce social content prep from 4 hours to 15 minutes
  • Automate up to 80 percent of drafting and formatting work
  • Improve brand consistency by using a shared schema and prompt
  • Connect Gmail, Google Docs, X, Instagram, Facebook, LinkedIn, and ImgBB in one flow
  • Scale to handle five times more posts without adding headcount

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Gmail, Twitter, Facebook Graph API, LinkedIn, Google Docs, OpenAI, ImgBB and Pollinations AI. See the Tools Required section above for links to create accounts with these services.
  3. In n8n Cloud, open Credentials. For Gmail, double click the Gmail node, choose Create new credential, select Gmail OAuth2, and follow the on screen steps to grant send permission.
  4. For Google Docs, open the Social Media Schema and Social Media System Prompt nodes, create Google Docs OAuth2 credentials, and authorize access to the documents.
  5. Create an OpenAI API key in your OpenAI account. In the gpt model nodes, click Create new credential, select OpenAI API Key, and paste the key.
  6. Connect Twitter by opening the X Post node, choose Create new credential, select Twitter OAuth2, and approve the app for posting.
  7. Connect Facebook and Instagram by opening the Facebook Post and Instragram Post nodes, choose Facebook Graph API credentials, and authorize the correct pages and Instagram Business account.
  8. Connect LinkedIn by opening the LinkedIn Post node, create LinkedIn OAuth2 credentials, and approve the organization page posting scope.
  9. For images, get an ImgBB API key from the ImgBB website. In the Save Image to ImgBB node, add the API key. Pollinations AI can be used as configured or updated in the HTTP Request node.
  10. Open the Google Docs nodes and set the exact document IDs for your schema and system prompt. Make sure the docs are shared with the connected Google account.
  11. Send a test message through the Chat trigger. Check the Gmail approval email and confirm text, images, and links render correctly. Approve to publish and verify posts on each platform.
  12. If posting fails, review OAuth scopes, page permissions, image size limits for Instagram and Shorts, and character limits for X and LinkedIn. Use the n8n execution log to find the failing node.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Facebook Graph API

Sign up

Free: $0 (no direct API charges; usage subject to rate limits)

Gmail

Sign up

No cost: Personal Gmail (Gmail API has no usage-based pricing; quotas apply)

Google Docs

Sign up

Free: $0, Google Docs API usage at no additional cost (quota limits apply)

ImgBB

Sign up

3-Year Pro: $3.99 / mo (billed $143.64 every 3 years). Includes API access.

LinkedIn

Sign up

Self-serve developer products (e.g., Sign In with LinkedIn, Share on LinkedIn): $0; Partner/Marketing APIs require approval and have no public pricing.

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

Pollinations AI

Sign up

Free tier: $0 — anonymous or token API access (Seed tier, ad-supported)

Twitter

Sign up

Free tier: $0 / mo, 500 posts / mo and 100 reads / mo (X API v2)

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.