CASE STUDY 08 / 08 · CONTENT CREATION
AI Content Creation Workflow
This n8n workflow runs on a schedule. It reads pending ideas from a Google Sheet, loops through them, and an AI agent with an OpenAI chat model and memory writes each post. A Code step formats the text, a "Create a post" step publishes it, and the row is updated in the sheet so the idea is marked as done.

01 / THE PROBLEM
The challenge.
Keeping a content calendar full means writing post after post by hand — even before anything gets published, the writing alone can stall the whole schedule.
02 / THE SOLUTION
The connected answer.
This n8n workflow runs on a schedule. It reads pending ideas from a Google Sheet, loops through them, and an AI agent with an OpenAI chat model and memory writes each post. A Code step formats the text, a "Create a post" step publishes it, and the row is updated in the sheet so the idea is marked as done.
03 / HOW IT WORKS
Inside the logic.
A Schedule Trigger starts the workflow on its own, so content can be produced without anyone opening n8n.
The workflow reads rows from a Google Sheet — the list of content ideas — and a Loop Over Items node works through them one at a time.
An If node checks each row, so only rows that are ready for publishing move forward.
For a ready row, an AI agent takes over. It uses an OpenAI chat model with memory and a tool input, and writes the post from the details in the sheet.
A Code in JavaScript step formats the generated text, a "Create a post" step publishes it, and an Update Row step marks the row as done in the sheet so the same idea is not written twice.
- 01
Schedule Trigger
The workflow starts itself on a schedule — no manual run needed.
- 02
Get row(s) in sheet
Read the pending content ideas from a Google Sheet.
- 03
Loop Over Items
Work through the rows one at a time.
- 04
If
Check each row so only items that are ready move forward.
True
The row is ready — send it to the AI agent.
False
Skip this row for now.
- 05
AI agent writes the post
An OpenAI chat model with memory (and a tool input) drafts the post for each row.
- 06
Code in JavaScript
Format and clean the generated text before publishing.
- 07
Create a post
Publish the finished post.
- 08
Update row in sheet
Mark the row as done in Google Sheets so it is not processed again.
BUILD GUIDE
How to build it.
A practical guide to recreating this workflow in n8n.
- 01
Build the content sheet
Create a Google Sheet with a column for the idea or topic and a status column (e.g. pending / done). Connect your Google account in n8n credentials.
- 02
Add the Schedule Trigger
Add a Schedule Trigger node and set how often the workflow should run — for example every morning or once a week.
- 03
Read the pending ideas
Use a Google Sheets "Get row(s)" node to read the sheet, then a Loop Over Items node so each row is processed one at a time.
- 04
Check each row with an IF node
Add an IF node that only lets rows through when they are ready — for example when the status column says pending.
- 05
Build the AI agent
Add an AI Agent node with an OpenAI Chat Model, memory, and a tool input. Write a system prompt describing the tone, length and format of each post, using the row’s details as the topic.
- 06
Format the text with a Code node
Add a Code in JavaScript node to tidy the generated text — trimming whitespace, removing markdown artefacts, or shaping the fields the publishing step expects.
- 07
Publish the post
Connect the publishing node ("Create a post") with your account credentials and map the formatted title and body into it.
- 08
Mark the row as done
Add a Google Sheets "Update row" node that sets the status column to done, so the same idea is not published twice.
- 09
Test and activate
Add one or two test rows, run the workflow, check the generated posts and the status updates, then switch it to Active.
04 / TECHNOLOGY USED
Connected tools.
05 / WORKFLOW SCREENSHOTS
Behind the build.
AI Content Creation workflow in n8n
Select the image to enlarge.
06 / RESULT
What it demonstrates.
The pictured workflow turns a Google Sheet of content ideas into published posts on a schedule: it reads the rows, writes each post with an AI agent, publishes it, and marks the row as processed — with no manual step in the loop.
WHAT THIS PROJECT SHOWS
UP NEXT
AI Customer Support Agent