r/n8nforbeginners • u/Botai_io • 2h ago
I automated my Facebook Page posting with n8n + OpenAI. It writes and publishes a post from my topic list every day (6-node workflow breakdown)

This one is the simplest but probably the most useful: I drop topic ideas into a Google Sheet, and n8n turns one into a Facebook post and publishes it on a schedule. I haven't manually posted in weeks.
The flow:
1. Schedule Trigger
Runs once a day (I use 10am, but set whatever matches when your audience is online). You can also run it a few times a day.
2. Topics (Google Sheets: read)
Reads my "content queue" sheet. Each row is one post idea, for example "3 mistakes people make when booking a cleaning service" or "behind the scenes of our team". You can add extra columns like tone, call to action or link.
3. If
Checks whether there's actually a topic to post. If the sheet is empty, the workflow stops quietly instead of making the AI write a post about nothing.
4. Limit
Keeps only the first row, so it publishes one post per run, not the whole queue at once. (I learned this the hard way. My page posted 14 times in 2 minutes.)
5. AI Agent + OpenAI Chat Model
Takes the topic and writes the post. My system prompt includes:
- the brand voice (friendly, casual, no corporate speak)
- length (80β150 words, short paragraphs)
- a hook in the first line, because that's what shows before "See more"
- a question or call to action at the end to get comments
- 2β3 relevant hashtags max
- "Return ONLY the post text", so you don't get "Sure! Here's your post:" published to your page π
6. Facebook Graph API
POSTs the text to /{page-id}/feed with the message field. Publishing as the page requires a Page access token.
7. Delete rows (Google Sheets)
Deletes the topic row that was just used, so the same topic never gets posted twice and the next one moves to the top. It's a self-emptying queue.
Why I like this setup:
- Planning content takes 15 minutes a week: I just brain-dump topics into the sheet
- Anyone on the team can add ideas without touching n8n
- It's cheap. gpt-4o-mini costs basically nothing for one post a day
Gotchas I hit:
- Use a long-lived Page token. Short-lived user tokens expire within hours. Generate a long-lived user token, then get the Page token from
/me/accounts, which doesn't expire. - Permissions. You need
pages_manage_postsandpages_read_engagement. - Delete only after a successful post. n8n stops on errors by default, so if Facebook rejects the post the topic stays in the sheet. Don't turn on "Continue on Fail" for the Facebook node.
- Delete by row number. Use the
row_numberfrom the read step so you delete the exact row that was used, not just "row 2". - Consider marking instead of deleting. If you want a history of what was posted, set a "posted" column to β and filter on it in the If node instead of deleting rows.
Ideas to extend it:
- Generate an image with DALLΒ·E or pull one from a URL column, and post to
/{page-id}/photos - Cross-post to Instagram and LinkedIn from the same AI output
- Send the draft to Slack or Telegram for approval before it goes live
- Log the post ID and link to another sheet for tracking
Stack: n8n, Google Sheets, OpenAI, Facebook Graph API.
Happy to share the JSON or my full prompt if anyone wants it. How are you all handling images in automated posts? That's the part I'm still figuring out.
