See llms.txt for all machine-readable content.

Back to Templates

Create LinkedIn, Instagram and X drafts with Gemini and Google Sheets

Quick overview

This workflow collects a source URL or text via an n8n Form, uses Google Gemini to generate LinkedIn, Instagram, and X draft posts plus an image idea in your brand voice, and appends the drafts to a Google Sheets spreadsheet.

How it works

  1. Receives a submission from an n8n Form with a Source URL and/or some idea text.
  2. If a URL is provided, it fetches the web page via HTTP and extracts the title and paragraph text from the HTML.
  3. Falls back to the submitted idea text when no URL is provided or when the page fetch fails, then checks that there is usable source text.
  4. If source text exists, sends the source, brand settings, and writing rules to Google Gemini to generate LinkedIn, Instagram, and X drafts plus an image idea.
  5. Parses the model response into structured fields and formats them into a single row with a Draft status.
  6. If no usable text is available, creates a row indicating the page could not be read and asks you to paste text in the form.
  7. Appends the resulting row to Google Sheets for review and manual publishing.

Setup

  1. Add a Google Gemini API credential and select the Gemini model used for generating the posts.
  2. Connect Google Sheets credentials, then select the target spreadsheet and sheet in the Google Sheets append step.
  3. Use an empty sheet (n8n creates the headers on the first run) or one with these exact headers: Date, Source, LinkedIn, Instagram, X, Image idea, Status.
  4. Update the Brand settings values (brand name, description, audience, voice, language, and call to action) to match your business.
  5. Execute the workflow once and use the generated form URL to submit a Source URL and/or idea text.

Requirements

  • An n8n instance (cloud or self-hosted)
  • A Google Gemini API key (the free tier is enough)
  • A Google account with access to Google Sheets

Customization

  • Change the Brand settings values to match your brand, audience, tone, language and call to action
  • Edit the writing rules in the Write the posts step to change length, style or hashtags
  • Swap the Gemini model for any other chat model supported by n8n
  • Add or remove social networks by updating the output parser and the Prepare row step
  • Replace the form trigger with a schedule or RSS trigger to generate drafts automatically