Generate LinkedIn posts from Gmail topics with Google Sheets and Gemini
Needs changesWhat this workflow does
This AI workflow has 25 nodes and runs on Gmail events (plus 1 other trigger). Along the way it connects LinkedIn, Google Gemini Chat Model, Google Sheets and Gmail.
How it runs
Trigger: On Gmail events (plus 1 other trigger).
- Extract Email Topics (Code): runs custom JavaScript code
- Read All Sheet Rows (Google Sheets): uses Google Sheets
- Mark Email as Read (Gmail): mark as read
- Detect Invalid Sheet Rows (Code): runs custom JavaScript code
- Fetch Rows from Sheet (Google Sheets): uses Google Sheets
- Check Rows for Deletion (If): checks a condition and branches into true / false
- Find Available Rows in Sheet (Code): runs custom JavaScript code
- Remove Invalid Sheet Rows (Google Sheets): delete
- Filter Unrefined Rows (Code): runs custom JavaScript code
- Insert Topic in Blank Row (Google Sheets): update
…plus 12 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102) · Other Google Gemini + Google Sheets templates (819) · Other Google Gemini + Gmail templates (518)
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in Content Creator Agent (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
- Also check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll).
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
Published 2026 — 6% of 2026 templates need changes for 3.0. See how template age affects 3.0 readiness →
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
| Removed in 3.0 | Replace 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. |
Nodes used (10)
- AI Agent
@n8n/n8n-nodes-langchain.agent - LinkedIn
n8n-nodes-base.linkedIn - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Google Sheets
n8n-nodes-base.googleSheets - Gmail
n8n-nodes-base.gmail - Gmail Trigger
n8n-nodes-base.gmailTrigger - Code
n8n-nodes-base.code - Summarize
n8n-nodes-base.summarize - Schedule Trigger
n8n-nodes-base.scheduleTrigger - If
n8n-nodes-base.if
From the author
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…