Skip to main content

Auto-generate & schedule LinkedIn posts from Google Sheets with GPT-4o

Workflow preview

Workflow preview
100%
Auto-generate & schedule LinkedIn posts from Google Sheets with GPT-4o preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Target audience Solo creators, PMs, and content teams who queue LinkedIn ideas in Google Sheets and want them posted on a fixed schedule with AI generated copy. How it works The workflow runs on a ...

Best for

  • Social Media automation workflows
  • Multimodal AI automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.scheduletrigger, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.linkedin, n8n-nodes-base.googlesheets, n8n-nodes-base.limit, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Snehasish Konger.

Original n8n.io source

1.1 Workflow description

Title
Auto-generate & schedule LinkedIn posts from Google Sheets with GPT-4o
Workflow name
Auto-generate & schedule LinkedIn posts from Google Sheets with GPT-4o

Target audience

Solo creators, PMs, and content teams who queue LinkedIn ideas in Google Sheets and want them posted on a fixed schedule with AI-generated copy.

How it works

The workflow runs on a schedule (Mon/Wed/Fri at 09:30). It pulls the first Google Sheet row with Status = Pending, generates a LinkedIn-ready post from Post title using an OpenAI prompt, publishes to your LinkedIn profile, then updates the same row to Done and writes the final post back to the sheet.

Prerequisites (use your own credentials)

  • Google Sheets (OAuth2) with access to the target sheet
  • LinkedIn OAuth2 tied to the account that should post — set the person field to your profile’s URN in the LinkedIn node
  • OpenAI API key for the Chat Model node
  • Store secrets in n8n Credentials. Never hard-code keys in nodes.

Google Sheet structure (exact columns)

Minimum required columns

  • id — unique integer/string used to update the same row later
  • Status — allowed values: Pending or Done
  • Post title — short prompt/topic for the AI model

Recommended columns

  • Output post — where the workflow writes the final text (use this header, or keep your existing Column 5)
  • Hashtags (optional) — comma-separated list (the prompt can append these)
  • Image URL (optional) — public URL; add an extra LinkedIn “Create Post” input if you post with media later
  • Notes (optional) — extra hints for tone, audience, or CTA

Example header row

id | Status | Post title | Hashtags | Image URL | Output post | Notes

Example rows (inputs → outputs)

1  | Pending | Why I moved from Zapier to n8n | #automation,#nocode |  |  | Focus on cost + flexibility
2  | Done    | 5 lessons from building a rules engine | #product,#backend |  | This is the final posted text... |

Resulting Output post (for row 1 after publish)

I switched from Zapier to n8n for three reasons: control, flexibility, and cost.
Here’s what changed in my stack and what I’d repeat if I had to do it again.

#automation #nocode

> If your sheet already has a column named Column 5, either rename it to Output post and update the mapping in the final Google Sheets Update node, or keep Column 5 as is and leave the node mapping untouched.

Step-by-step

  1. Schedule Trigger Runs on Mon/Wed/Fri at 09:30.
  2. Fetch pending rows (Google Sheets → Get Rows) Reads the sheet and filters rows where Status = Pending.
  3. Limit Keeps only the first pending row so one post goes out per run.
  4. Writing the post (Agent + OpenAI Chat Model + Structured Output Parser) Uses Post title (and optional Notes/Hashtags) as input. The agent returns JSON with a post field. Model set to gpt-4o-mini by default.
  5. Create a post (LinkedIn) Publishes {{$json.output.post}} to the configured person (your profile URN).
  6. Update the sheet (Google Sheets → Update) Matches by id, sets Status = Done, and writes the generated text into Output post (or your existing output column).

Customization

  • Schedule — change days/time in the Schedule node. Consider your n8n server timezone.
  • Posts per run — remove or raise the Limit to post more than one item.
  • Style and tone — edit the Agent’s system prompt. Add rules for line breaks, hashtags, or a closing CTA.
  • Hashtags handling — parse the Hashtags column in the prompt so the model appends them cleanly.
  • Media posts — add a branch that attaches Image URL (requires LinkedIn media upload endpoints).
  • Company Page — switch the person field to an organization URN tied to your LinkedIn app scope.

Troubleshooting

  • No post created

    • Check the If/Limit path: is there any row with Status = Pending?
    • Confirm the sheet ID and tab name in the Google Sheets nodes.
  • Sheet not updating

    • The Update node must receive the original id. If you changed field names, remap them.
    • Make sure id values are unique.
  • LinkedIn errors (403/401/404)

    • Refresh LinkedIn OAuth2 in Credentials.
    • The person/organization URN is wrong or missing. Copy the exact URN from the LinkedIn node helper.
    • App lacks required permissions for posting.
  • Rate limit (429) or model errors

    • Add a short Wait before retries.
    • Switch to a lighter model or simplify the prompt.
  • Post too long or broken formatting

    • LinkedIn hard limit is ~3,000 characters. Add a truncation step in Code or instruct the prompt to cap length.
    • Replace double line breaks in the LinkedIn node if you see odd spacing.
  • Timezone mismatch

    • The Schedule node uses the n8n instance timezone. Adjust or move to a Cron with explicit TZ if needed.

Need to post at a different cadence, or push two posts per day? Tweak the Schedule and Limit nodes and you’re set.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 2 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 3 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 4 - writing the post

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.8

Block 5 - Create a post

Type / Role
n8n-nodes-base.linkedIn - linkedIn
Config choices
Version 1

Block 6 - Fetch the pending contents from the sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 7 - Selecting the first one only

Type / Role
n8n-nodes-base.limit - limit
Config choices
Version 1

Block 8 - Update row to Done in sheet1

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 9 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Auto-generate & schedule LinkedIn posts from Google Sheets with GPT-4o
Complexity intermediate
Nodes 12
Categories Social Media, Multimodal AI
Author Snehasish Konger
Published 06 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8332/8332.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Auto-generate & schedule LinkedIn posts from Google Sheets with GPT-4o do?

Target audience Solo creators, PMs, and content teams who queue LinkedIn ideas in Google Sheets and want them posted on a fixed schedule with AI generated copy. How it works The workflow runs on a ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Social Media, Multimodal AI use case.