Auto-Turn Gmail Newsletters into LinkedIn Insight Posts
Gmail emails → OpenAI extract & generate → LinkedIn auto-publish
- Who
- Content creators, marketers, and business professionals who want to repurpose regular newsletters into LinkedIn posts
- You get
- Automatically filter emails, extract key points, generate on-brand LinkedIn posts, and publish directly
Constraints
Requires an n8n instance; credentials needed: gmailOAuth2, openAiApi, linkedInOAuth2Api. The Gmail node filters by sender; OpenAI nodes use o3-mini-2025-01-31; the LinkedIn node requires OAuth2 authorization and a person ID. No runtime cost estimate is provided by the source.
What they did
This n8n template demonstrates a full automation flow: fetch newsletter emails from a specific Gmail sender, extract news items (headline + summary) via one OpenAI node, split them out, generate concise LinkedIn posts via a second OpenAI node, and publish each to LinkedIn. Node order: ManualTrigger → Gmail → Extract News Items → Split Out → Create LinkedIn Posts → LinkedIn.
How it went
Source is an n8n official template; no author-reported runtime results or publishing metrics are provided. The 3391 template page views are not execution outcomes.
Worth knowing
1. The template uses model o3-mini-2025-01-31; you may switch to another available model in n8n, but output stability must be tested yourself. 2. The LinkedIn node person field must be replaced with your actual profile ID; EI5XKdiMv1 in the template is only an example. 3. Prompt variables ($json.text, $json.headline, $json.summary, $json.message.content) depend on upstream node output structure; adjust if your email format differs. 4. To change post tone or length limits, edit the prompt in Create LinkedIn Posts; to filter additional senders, adjust the Gmail node filters. 5. Optional Function nodes for extra formatting after Split Out are suggested by the source but not required. 6. This site has not tested the workflow; after building, test the full chain with a single email and review the generated post before enabling automatic triggers.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- Gmail node: connect Gmail OAuth2 credentials.
- Extract News Items node: connect OpenAI API credentials.
- Create LinkedIn Posts node: connect OpenAI API credentials.
- LinkedIn node: connect linkedInOAuth2Api credentials.
Configuration to replace
- Source template is n8n public workflow #3509 (~7 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-25
Steps
Configure Gmail trigger and filter
Add or modify the Gmail node in n8n, rename it to 'Filter Gmail Newsletter'. Set filters.sender to your newsletter sender address (e.g., [email protected]), operation to getAll, and limit as needed. Configure gmailOAuth2 credentials and authorize. Use the 'When clicking Test workflow' manual trigger for testing.
Extract news items with OpenAI
Add an OpenAI node and rename it to 'Extract News Items'. Select model o3-mini-2025-01-31 (or o3-mini). Enable jsonOutput. Place the following prompt in the messages field; this node reads the email body from Gmail and extracts 5 main news headlines and summaries.
Execution prompt · Source text。OpenAI node Extract News Items, messages.values[].content field
=Given the following newsletter content, identify and summarize the 5 main news items. Focus on factual updates like new AI tools, product launches, or strategic investments. For each item, extract a headline and provide a concise summary. Please ignore purely promotional sections (e.g., calls to book demos or product advertisements). <text> {{ $json.text }} </text>Split out multiple news items
Add a Split Out node and set fieldToSplitOut to message.content.news_items (the news list field from the previous OpenAI JSON output). This splits the array into individual records, each processed in its own branch.
Generate LinkedIn posts with OpenAI
Add a second OpenAI node and rename it to 'Create LinkedIn Posts'. Use the same model, o3-mini-2025-01-31. Place the following prompt in the messages field; this node receives headline and summary per item and outputs a styled LinkedIn post.
Execution prompt · Source text。OpenAI node Create LinkedIn Posts, messages.values[].content field
=Using the news item details below: Headline: {{ $json.headline }} Summary: {{ $json.summary }} Craft a concise, non-promotional LinkedIn post in a smart, deadpan style with subtle humor. Focus on clearly conveying the main points and insights so readers gain practical value. - Break up the text into short paragraphs or bullet points for clarity. - Use line breaks where helpful. - End with an observation or question that encourages reflection—without being overly salesy or flashy. - Keep it under 80 words total.Publish to LinkedIn
Add a LinkedIn node and rename it to 'Post to LinkedIn'. Set the text field to ={{ $json.message.content }} to reference the generated post from the previous step. Configure linkedInOAuth2Api credentials and confirm the person parameter is your actual LinkedIn profile ID (the template example EI5XKdiMv1 must be replaced). Executing the workflow publishes the post directly to your LinkedIn account.
Prompt you can copy
Setup guidance · Editorial suggestion。Give to setup assistant; confirm inputs and permissions first
This block is the prompt. Ads are never placed here.
You are an n8n workflow setup assistant. The user wants to replicate the automation that turns Gmail newsletters into LinkedIn posts. First confirm they have: 1) access to an n8n instance; 2) Gmail OAuth2, OpenAI API, and LinkedIn OAuth2 credentials; 3) a known newsletter sender address. Then guide them to import the template or build nodes manually, checking Gmail filter conditions, OpenAI prompt variable names ($json.text / $json.headline / $json.summary / $json.message.content), and connection order. If they want to change tone, suggest testing a single item in Extract News Items or Create LinkedIn Posts before batch runs.
Before building, confirm all three OAuth/API credentials are ready and you have the newsletter sender email address.
Source
Transform Gmail newsletters into insightful LinkedIn posts using OpenAI · informed-simplicity · n8n.io · 2025-04-10
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.