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

⚡ 643 views · 📱 Social Media & Email Marketing

💡 Pro Tip — If you’re pulling LinkedIn data through HTTP requests or dealing with API restrictions, there’s a community node called ScraperNode that handles this natively. It has dedicated scrapers for profiles, companies, jobs, and people search — you just pass a URL and get structured data back.

View All Scrapers

Description

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 Sheet structure (exact columns)

Minimum required columns

Recommended columns

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

Troubleshooting

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

đź”— Nodes Used

Google Sheets, LinkedIn, Schedule Trigger, AI Agent, OpenAI Chat Model, Structured Output Parser

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup