Automate LinkedIn posts with n8n: AI agents that research, write, and publish on approval
Build an n8n pipeline that researches a topic, drafts a LinkedIn post in two competing styles, generates an image brief, and publishes to LinkedIn only after you approve it in Airtable.
Posting consistently on LinkedIn is a content-supply problem, not a willpower problem. The blank page wins because researching a topic, writing it in a voice that does not sound like a press release, and shipping it on a schedule is real work. Most "AI post generators" solve the wrong half: they spray generic text with zero research and zero human gate, and your feed starts to read like everyone else's.
This guide builds the version that actually holds up. You approve a topic, AI agents research it with live search, two different copywriters draft competing versions, an image brief gets generated, and the draft lands in Airtable for review. Nothing publishes to LinkedIn until a human flips a status to Approved. Speed with a gate.
Available resources#
This build uses two assets you will set up below:
- n8n workflow "LinkedIn - Post Automation" (research + drafting + publishing).
- Airtable base "Linkedin Post Automation" with two tables: Topics and LinkedIn Posts.
What you'll need#
Before you begin, make sure you have:
- An n8n account (cloud or self-hosted) with the workflow editor.
- An Airtable account to manage the Topics and LinkedIn Posts tables.
- A Google Gemini API key for the research and writing agents (any LLM works; this build uses Gemini).
- A SerpApi key so the research agent can search the live web.
- LinkedIn API access (a connected LinkedIn page or profile credential in n8n) to publish.
Overview of the automation#
The automation runs in two phases that share one Airtable base. A human approval sits between them.
- Draft creation. Approving a topic triggers a research agent, then one of two copywriting agents (chosen at random), then an image-brief agent. The finished draft is written to the LinkedIn Posts table as
Ready For Review. - Publishing. Approving a draft triggers the LinkedIn node to publish the post, then flips its status to
Posted.
Trigger fires only when you approve a topic row.
Gemini + SerpApi search + Think tool. Outputs Idea, Description, Significance, Implementation.
Routes to one of two copywriting styles so drafts do not all sound the same.
Point-of-View or Problem-Agitate-Solution draft of the post.
Turns the post into a structured image brief for generation.
Draft + image brief written for human review.
Publish on approval, then mark the row Posted.
- LinkedIn: published post (only after approval)
- Airtable: full audit trail of topics, drafts, and statuses
The important design decision is the approval gate between phases. Research and drafting are cheap and reversible. Publishing to a company page is neither. Keeping them in separate trigger-driven flows means a bad draft dies quietly in Airtable instead of going live.
Step-by-step setup#
1. Set up the Airtable base#
Create a base (the example names it "Linkedin Post Automation") with two tables.
Topics drives phase one:
Topics (single line text) the headline idea
Discription (long text) context for the research agent
Status (single select) Approved, Researched, DeclineLinkedIn Posts holds the generated drafts and drives phase two:
LinkedIn Post (long text) the generated post body
Image Description (long text) the structured image brief
Status (single select) Ready For Review, Approved, Posted, Decline2. Connect credentials in n8n#
Add four credentials so the agents and publishing node can authenticate:
- Airtable (personal access token) with read and write on the base.
- Google Gemini for the chat models behind every agent.
- SerpApi for the research agent's
Search Tool. - LinkedIn for the page or profile you publish from.
3. Build phase one: research and draft#
Trigger on an approved topic. An Airtable Trigger watches the Topics table. A Filter node (Status = Approved) lets only approved rows through, so you stay in control of what gets researched.
Research the topic. The Topic Research Agent runs on Gemini with two tools wired in: a Search Tool (SerpApi) for live information and a Think tool for reasoning. A Structured Output Parser (wrapped in an Auto-fixing Output Parser) forces clean JSON:
{
"Idea": "",
"Description": "",
"Significance": "",
"Implementation": ""
}The auto-fixing wrapper matters: LLMs occasionally return slightly malformed JSON, and it re-prompts the model to repair the output instead of failing the run.
Pick a writing style at random. A Code node returns a random 1 or 2, and a Switch routes to one of two copywriting agents:
function getRandomNumber() {
const randomNum = Math.floor(Math.random() * 2) + 1;
return [{ json: { randomNumber: randomNum } }];
}
return getRandomNumber();- Point of View agent: a conviction-led, conversational take that opens with a strong statement.
- PAS agent: the Problem, Agitate, Solution framework for higher-engagement posts.
Randomizing the style stops your feed from falling into one repetitive template. Both agents receive the same research input:
Idea: {{ $('Topic Research Agent').item.json.output.Idea }}
Description: {{ $('Topic Research Agent').item.json.output.Description }}
Significance: {{ $('Topic Research Agent').item.json.output.Significance }}
Implications: {{ $('Topic Research Agent').item.json.output.Implementation }}Merge and generate an image brief. A Merge node collapses the two possible branches back to one (only the chosen branch carries data). The Image Description agent then converts the finished post into a structured visual brief (main scene, key elements, style, colors, what to avoid) ready for any image generator.
Write the draft to Airtable. A Create Record in LinkedIn Posts stores the post body and image brief with Status = Ready For Review, and an Update record marks the source topic Researched so it is not picked up again.
4. Build phase two: review and publish#
Trigger on an approved draft. A second Airtable Trigger watches the LinkedIn Posts table, and a Filter (Status = Approved) only proceeds once a human has reviewed the draft and flipped the status.
Publish to LinkedIn. The LinkedIn node posts the approved text:
{{ $json.fields['LinkedIn Post'] }}Close the loop. An Update record sets the row to Posted, so your Airtable becomes a clean history of what shipped and what was declined.
Testing the workflow#
Validate each phase before trusting it with your real page:
- Approve a topic. Add a row to Topics with an idea and description, set
Status = Approved, and wait. Within a minute or two a new row should appear in LinkedIn Posts. - Read the draft. Confirm the
LinkedIn Postfield has a researched, on-voice post and theImage Descriptionfield has a structured brief. Run it a few times to see both the POV and PAS styles appear. - Approve the draft. Set the LinkedIn Posts row to
Status = Approved. - Confirm it published. Check that the post is live on LinkedIn and the row flipped to
Posted. Decline a draft instead and confirm nothing publishes.
If a draft never appears, check the research agent's output parser first: a malformed JSON response is the most common failure point, which is exactly why the auto-fixing parser is wired in.
Customization options#
- Swap the model. Replace Gemini with OpenAI, Anthropic, or any chat model n8n supports. The agents and parsers stay the same.
- Add more writing styles. Extend the
Switchto three or four branches (storytelling, listicle, contrarian) and widen the random range in theCodenode. - Auto-generate the image. Feed the
Image Descriptionbrief into an image model and attach the result to the LinkedIn post instead of stopping at the brief. - Route approvals through Slack. Post the draft to a Slack channel with Approve and Decline buttons instead of editing Airtable by hand.
- Schedule publishing. Add a delay or a scheduled queue so approved posts go out at peak engagement times rather than immediately.
Common mistakes that quietly break this#
- No human gate before publishing. Wiring the LinkedIn node straight off the writing agent means one hallucinated claim goes live on your company page. Keep the approval filter.
- Skipping the auto-fixing parser. A raw structured parser fails the whole run on the first malformed JSON. The auto-fixing wrapper repairs and retries.
- Renaming Airtable fields without updating nodes. Expressions reference field names literally (including
Discription); a rename silently returns empty values. - Letting the agent write without search. Without the SerpApi
Search Tool, the research agent invents specifics. Live search is what keeps posts current and credible.
Conclusion#
You now have a LinkedIn content engine that does the heavy lifting (research, drafting in two voices, and an image brief) while keeping a human firmly in charge of what actually publishes. Approve a topic and a reviewable draft appears in Airtable; approve the draft and it goes live, with every step logged. Feed it a steady list of topics and the blank page stops being the reason you went quiet.
Keep reading
- AI agents & LLMn8nImplementationAI agents & LLM
How to Automate Lead Follow-Ups with n8n, Gemini AI, Slack, and Gmail
Install an n8n workflow that captures website form leads, drafts a reply with one AI agent, then runs a Slack approve or rewrite loop before saving a Gmail draft, logged in Google Sheets.
12 min · - AI agents & LLMn8nPlaybookAI agents & LLM
AI form replies with human-in-the-loop: architecture for n8n, Slack, and Google Sheets
Design a form-to-reply pipeline in n8n: capture submissions, draft with an AI agent, route Slack approvals, send email only after sign-off, and track every row in Google Sheets.
7 min · - Business processn8nImplementationBusiness process
How to Automate Customer Review Management with n8n, Gmail, and Gemini AI
Install an n8n workflow that emails review requests, filters unhappy feedback privately, logs ratings in Google Sheets, and drafts Google review replies with Gemini AI.
12 min ·