Templates / Generate LinkedIn posts from Gmail topics with Google Sheets and Gemini

Generate LinkedIn posts from Gmail topics with Google Sheets and Gemini

Needs changes

by Huzaifa Jamil · 49 views · created 2026-07-30 · Social Media, Multimodal AI

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.

What to replace before upgrading

Removed in 3.0Replace with
AI Agent v1 (old agent modes)
Content Creator Agent (v1.7)
Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Worth a look

Nodes used (10)

AI AgentLinkedInGoogle Gemini Chat ModelGoogle SheetsGmail

What it does

Quick overview This workflow captures LinkedIn post topics from incoming Gmail messages into Google Sheets, then runs daily cleanup and AI generation with Google Gemini to publish a post to a LinkedIn organization page, updating the sheet and sending Gmail notifications. How it works 1. Triggers every minute on new unread Gmail messages matching the configured search query. 2. Extracts comma-separated topics from the email text, normalizes them, finds the next blank rows in Google Sheets, writes the topics into the sheet, and emails a formatted confirmation summary. 3. Runs daily on a schedule, loads all rows from Google Sheets, identifies and deletes invalid/empty rows with leftover metadata to keep the sheet consistent. 4. Filters the sheet to find topics whose REFINED status is not TRUE and marks those rows as refined in Google Sheets. 5. Retrieves the first Google Sheets row where POSTED? is No and REFINED is true, and stops with a Gmail alert if no topics are available. 6. Uses Google Gemini (via an AI agent prompt) to generate a formatted LinkedIn post from the selected topic and publishes it to the configured LinkedIn organization page. 7. Updates the same Google Sheets row with POSTED?=Yes plus the current date and time, then sends a Gmail notification confirming the post was published. Setup 1. Connect credentials for Gmail OAuth2, Google Sheets OAuth2, LinkedIn OAuth2, and a Google Gemini (PaLM/Google AI) API key. 2. Update all Gmail nodes with your recipient address, sender name, and any Gmail Trigger search query you want to use (for example, to filter topic-submission emails). 3. Set your Google Sheets document and sheet, and ensure the sheet has the columns TOPICS, REFINED, POSTED?, DATE, and TIME (with rownumber available for matching). 4. Update the LinkedIn organization ID and ensure the authenticated LinkedIn account has permission to post as that organization. 5. Review the daily schedule time and timezone-dependent date/time formatting and adjust them to match your posting schedule. Additional info This workflow is created by Huzaifa Jamil. For any Query and Curiosity email here [email protected]

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.