Generate and publish LinkedIn posts with OpenAI, Gmail, and Google Sheets

Go to Workflow
5 views
Built by Dr. Firas Dr. Firas
Created on July 28, 2026

Description

Quick overview
This workflow generates LinkedIn post ideas and drafts with OpenAI, routes approvals through Gmail replies, tracks each content cycle in Google Sheets, and publishes the selected draft to LinkedIn as a person or organization.

How it works
Starts manually and uses OpenAI to generate a numbered list of LinkedIn post idea titles for the configured niche and audience.
Logs the idea batch and run settings to Google Sheets and emails the ideas to your Gmail inbox with a correlation ID in the subject.
Polls Gmail for unread replies containing the correlation ID, extracts the reply number, and looks up the matching row in Google Sheets.
If the sheet row is in the ideas stage, it uses OpenAI to generate multiple LinkedIn post drafts for the selected idea, updates Google Sheets with the drafts, and emails them for final approval.
If the sheet row is in the drafts stage, it selects the chosen draft text and publishes it to LinkedIn with public visibility as the configured person or organization.
Updates the Google Sheets row to mark the post as posted and sends a Gmail confirmation email with a preview.

Setup
Add credentials for OpenAI, Gmail, Google Sheets, and LinkedIn (Community Management authentication) in n8n.
Create/select a Google Sheets spreadsheet and sheet used as the content tracker, and map it in all Google Sheets steps (append, lookup, and updates).
Update the Configuration values, especially the notification email address, niche/audience, idea/draft counts, word limits, and the OpenAI model.
Configure LinkedIn posting by setting post-as mode (person or organization) and filling in the required LinkedIn URNs (person URN and/or organization URN) in the publish step.
Ensure your approval replies keep the original email subject containing the [CID: …] token and reply with only the idea/draft number so the workflow can parse it.

Additional info
šŸ“„ Open full documentation on Notion

Need help customizing?
Contact me for consulting and support : Linkedin

MY NEW YOUTUBE CHANNEL
šŸ‘‰ Subscribe to my new YouTube channel. Here I'll share videos and Shorts with practical tutorials and FREE templates for n8n.

Nodes Used (6)

AI Agent
@n8n/n8n-nodes-langchain.agent
Gmail
n8n-nodes-base.gmail
Google Sheets
n8n-nodes-base.googleSheets
LinkedIn
n8n-nodes-base.linkedIn
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured