This n8n workflow runs every morning at 5:00. It takes a topic from a Google Sheet, has AI write a Facebook post about it, downloads the image from Google Drive and posts both to your Facebook Page. Finally it marks the row as “posted” in the Sheet, so the same post never goes out twice.
In short
- Schedule Trigger runs the workflow every day at 5:00.
- Google Sheets gives the first row whose
statusis empty (topic + image link). - An AI Agent (DeepSeek + Structured Output Parser) writes the post; Google Drive downloads the image.
- An HTTP Request to
/PAGE_ID/photospublishes it, then the row is markedposted.
Before you start: posting to a Page needs a Page token, saved in n8n as a credential named
FB Page. The step-by-step guide is here: How to create a never-expiring Facebook Page token with a system user.
What you need
- n8n (self-hosted or n8n Cloud)
- A Google account, with Google Sheets and Google Drive credentials in n8n
- An API key for an AI chat model (we used DeepSeek; OpenAI or Gemini work too)
- The
FB Pagecredential made from your Page token (guide)
Step 1: Set up the Google Sheet
Create a Google Sheet called Facebook Posts with four columns in the first row:
id: a unique number for each post (1, 2, 3…)topic: what the post is about, in one line. The AI writes the full post from this.image: the Google Drive link to the post’s imagestatus: leave it empty. The workflow writespostedonce the post is published.

The images must be in the Drive of the same Google account that n8n’s Google Drive credential uses.
Step 2: Schedule Trigger
- New workflow → Add first step → On a schedule.
- Trigger Interval: Days, Days Between Triggers:
1, Trigger at Hour: 5am. - Set the workflow’s Settings → Timezone to yours (e.g.
Asia/Dhaka), otherwise it runs on the server’s time.
Step 3: Get row(s) in sheet
Next node: Google Sheets → Get row(s) in sheet.
- Credential: your Google Sheets account
- Document:
Facebook Posts, Sheet:Sheet1 - Filters → Add Filter: Column
status, leave Value empty. Only rows that haven’t been posted yet come through. - Options → Return only First Matching Row: on. One post per run.
Step 4: AI Agent (DeepSeek + Structured Output Parser)
Add an AI Agent node:
- Source for Prompt: Define below, Prompt (User Message):
{{ $json.topic }} - Require Specific Output Format: on
- Options → System Message: tell the AI what to write. We used
write a facebook post based on this topic.For better results, set the language and style, e.g.Write an engaging Facebook post in English about this topic. Short paragraphs, a few emojis, 3–5 hashtags. Return only the post text.
Attach two sub-nodes under the AI Agent:
- Chat Model → DeepSeek Chat Model: create a credential with your DeepSeek API key and pick a model.
- Output Parser → Structured Output Parser: Schema Type Generate From JSON Example, JSON Example:
{ "topic": "" }
The AI’s post text then always arrives in $json.output.topic, which the later nodes read.
Step 5: Download file (Google Drive)
- Add a Google Drive → Download file node.
- File: By URL, value:
{{ $('Get row(s) in sheet').item.json.image }}
The image arrives as binary data in a field called data, which the next node sends to Facebook.
Step 6: HTTP Request — post to the Facebook Page
- Method:
POST - URL:
https://graph.facebook.com/v23.0/<PAGE_ID>/photos(replace<PAGE_ID>with your Page ID from step 3 of the token guide) - Authentication: Generic Credential Type → Query Auth → FB Page
- Send Body: on, Body Content Type: Form-Data
source: Type n8n Binary File, Input Data Field Namedatamessage: Type Form Data, Value{{ $('AI Agent').item.json.output.topic }}
On success the output contains id and post_id, and the post is live on your Page.
If the
sourceType is left as “Form Data” you’ll get(#324) Requires upload file. It must be n8n Binary File.

Step 7: Update row in sheet
Last node: Google Sheets → Update row in sheet, so this topic is never posted again.
- Same Document and Sheet as before
- Mapping Column Mode: Map Each Column Manually
- Column to match on:
id id:{{ $('Get row(s) in sheet').item.json.id }},status:posted
Step 8: Test and publish
- Click Execute workflow. The first row with an empty status is posted to the Page and its status becomes
posted. - If everything looks right, click Publish (or Active) at the top right. It now runs on its own every morning at 5:00.
- To queue more posts, just add rows to the Sheet. With no empty-status rows left, the workflow stops without posting.
Common problems
(#324) Requires upload file: set thesourceType to n8n Binary File.(#190)or(#200)token/permission errors: the Page token is wrong or missing permissions. Re-check the token guide, especiallypages_manage_posts.- The same post goes out again: check that step 7 runs and matches on the
idcolumn. - The image doesn’t download: make sure the file opens with the Google account behind n8n’s Drive credential.
Frequently asked questions
Can I use OpenAI or Gemini instead of DeepSeek?
Yes. Replace the Chat Model sub-node under the AI Agent with OpenAI, Gemini or any other chat model and keep the Structured Output Parser as it is.
How do I post more than once a day?
Add more trigger times in the Schedule Trigger (or use an hourly interval). Each run posts one row from the Sheet.
Can I post text without an image?
Yes. Remove the Download file node and send the HTTP Request to /PAGE_ID/feed with only a message field instead of /photos.
Why does n8n show “(#324) Requires upload file”?
The source field is set to Form Data. Change its Type to n8n Binary File with Input Data Field Name data.
Is n8n free?
The self-hosted Community Edition is free; n8n Cloud is a paid hosted plan. This workflow works on both.
