Set up your keyword schedule once in a Google Sheet and the workflow publishes daily Facebook posts automatically every morning at 6AM. For each keyword scheduled for today, it generates a headline and post content with GPT-4o-mini, creates a professional 1280x704 image with Ideogram, publishes the photo and caption directly to your Facebook Page, and logs the live post URL back to your sheet. Built for SEO agencies and social media managers who want consistent daily Facebook publishing across multiple clients without any manual work.
⚠️ Google Sheets OAuth2 appears in 2 steps — connect it in both 2. Google Sheets — Read Today Keywords and 10. Google Sheets — Log Posted URL
Estimated Setup Time: 20–25 minutes
Import the workflow — Open n8n → Workflows → Import from JSON → paste the workflow JSON → click Import
Prepare your keyword schedule sheet — Open your Google Sheet → ensure the keyword tab has these columns: Work Day, Keyword, Landing Page, Title, Content, Critical Instructions, Domain ID — fill Work Day with short day names like Mon, Tue, Wed, Thu, Fri
Connect Google Sheets for reading — Open node 2. Google Sheets — Read Today Keywords → click the credential dropdown → add Google Sheets OAuth2 → sign in with your Google account → authorize access → select your spreadsheet and the keyword tab
Update the Sheet ID and tab in node 2 — In node 2. Google Sheets — Read Today Keywords, select your actual spreadsheet from the document dropdown and your keyword tab from the sheet dropdown — the current values point to a sample sheet
Connect OpenAI — Open node 5. OpenAI — GPT-4o-mini Model → click the credential dropdown → add your OpenAI API key → test the connection
Add your Ideogram API key — Open node 7. HTTP — Generate Image Ideogram → find the header value field that currently says REPLACE_WITH_IDEOGRAM_API_KEY → replace it with your actual Ideogram API key — get it from your Ideogram account settings
Add your Facebook Page Access Token — Open node 9. HTTP — Post to Facebook → find the access_token body parameter that says REPLACE_WITH_FB_PAGE_ACCESS_TOKEN → replace it with your actual Page Access Token — get this from Facebook Developers → your app → Graph API Explorer → select your page → generate a Page Access Token. Also update the Page ID in the URL (628386143694589) to your actual Facebook Page ID
Connect Google Sheets for logging — Open node 10. Google Sheets — Log Posted URL → click the credential dropdown → select the same Google Sheets OAuth2 credential → select your spreadsheet and your log tab
Update the Sheet ID and log tab in node 10 — In node 10. Google Sheets — Log Posted URL, select your actual spreadsheet and the log tab — ensure the log tab has columns: Timestamp, Domain ID, Link Type, Live URLs
Activate the workflow — Toggle the workflow to Active — it will run automatically every morning at 6AM
Step 1 — Schedule: Daily 6AM
This step fires the workflow automatically every morning at 6AM. No manual trigger is needed. Once the workflow is active, it runs on its own every day including weekends.
Step 2 — Google Sheets: Read Today Keywords
Your keyword schedule sheet is read and filtered to only return rows where the Work Day column matches today's short day name (Mon, Tue, Wed, etc.). This uses today's actual day of week calculated at runtime so Monday only publishes Monday rows, Tuesday only publishes Tuesday rows, and so on.
Step 3 — Split: Loop Over Each Row
The filtered rows are processed one at a time using a loop. When a row is available it moves forward to content generation. When all rows have been processed the loop exits cleanly and the workflow ends. This ensures each keyword gets its own independent post — if one fails, the others continue.
Step 4 — AI Agent: Generate Post Content
GPT-4o-mini receives the keyword, landing page, title, content, and any critical instructions from the current row. It writes three outputs: a 6–8 word informational headline with no special characters, plain text post content in paragraphs of maximum 50 words with no links or generic intro/conclusion phrases, and a professional image generation prompt avoiding logos and brand references. The first 250 characters of the headline plus content must stand alone as a complete Twitter-ready summary.
Step 5 — OpenAI: GPT-4o-mini Model
This is the language model powering both the content generation and the output parser. It runs with default settings to produce natural, informational social copy.
Step 6 — Parser: Structured Post Output
This step enforces the exact three-field schema that GPT-4o-mini must return: Headline, Content, and image prompt. It validates and auto-fixes the output format so the fields are always clean and correctly structured before the image generation step.
Step 7 — HTTP: Generate Image Ideogram
The AI-generated image prompt is sent to the Ideogram v3 API. The image is generated at 1280x704 resolution in TURBO mode for fast delivery. A URL for the generated image is returned. If Ideogram fails, the step continues without stopping the full loop so remaining keywords still get published.
Step 8 — Code: Prepare Post Data
The headline, content, and landing page URL are assembled into the final post text formatted as: headline, then two line breaks, then content paragraphs, then Read more: [landing page URL]. The Domain ID from the sheet row is also extracted here for logging. The Ideogram image URL is carried forward for the Facebook post.
Step 9 — HTTP: Post to Facebook
The assembled caption and image URL are posted to the Facebook Page via the Graph API v23. The post is published as a photo post with the caption attached. The Facebook API returns a post ID on success. If the post fails, the step continues so the loop does not break on a single failed post.
Step 10 — Google Sheets: Log Posted URL
A new row is appended to your log sheet with four values: the current timestamp in MM-DD HH:mm:ss format, the Domain ID from the keyword row, the link type label "Social Sharing Fb", and the live Facebook post URL constructed from the post ID returned by Facebook. If the Facebook post failed, the Live URLs field will be empty for that row.
Step 11 — Wait: 1 Minute Rate Limit
The workflow pauses for exactly 1 minute before looping back to process the next keyword row. This prevents Facebook from rate limiting the Page when multiple posts are published in the same run. After the 1-minute wait, the loop returns to step 3 to pick up the next row.
✅ Day-of-week scheduling from a spreadsheet — Your entire week's content plan lives in one Google Sheet — the workflow reads only today's rows automatically without any configuration changes
✅ Full loop with rate limit control — Every keyword runs through content, image, post, and log in sequence with a 1-minute gap between posts — no manual spacing needed
✅ Twitter-ready first 250 characters — The prompt enforces a standalone summary in the first 250 characters so you can repurpose the same content for Twitter without any editing
✅ Professional images at no extra setup — Ideogram generates a unique 1280x704 business image for every post based on AI-written prompts — no Canva, no stock photos
✅ Error continuity on failure — All three external API steps (Ideogram, Facebook, and Google Sheets log) are set to continue on error so one failing post never breaks the entire day's run
✅ Live URL logged automatically — The exact Facebook post URL is written back to your sheet immediately after publishing so your reporting is always up to date
✅ Domain ID tracking per post — Every log row includes the Domain ID from your sheet so agencies managing multiple clients can filter and report by client
Change the publish time — In node 1. Schedule — Daily 6AM, change the trigger hour from 6 to any other hour to publish at a different time — for example set to 8 for 8AM or 18 for 6PM.
Add more columns to the keyword sheet — In node 4. AI Agent — Generate Post Content, you can reference additional columns from your sheet (e.g. Brand Voice, Tone, Target Audience) by adding them to the prompt context — just make sure the column headers exist in your sheet.
Change the image resolution or style — In node 7. HTTP — Generate Image Ideogram, change the resolution value from 1280x704 to 1024x1024 for a square image suited to Instagram, or change rendering_speed from TURBO to DEFAULT for higher quality rendering.
Post to a different Facebook Page — In node 9. HTTP — Post to Facebook, replace the Page ID in the URL (628386143694589) with your own Page ID — find your Page ID by going to your Facebook Page → About → Page Transparency, or from Facebook Developers.
Add a Slack notification after each post — After node 10. Google Sheets — Log Posted URL, add a Slack step that posts the headline and live Facebook URL to a #social-posting channel so your team gets notified in real time when each post goes live.
Workflow not triggering at 6AM:
No keywords being read from Google Sheets:
Work Day column in your sheet uses the exact short day name format that matches your system locale — the workflow uses en-US format which produces Mon, Tue, Wed, Thu, Fri, Sat, SunIdeogram not generating images:
REPLACE_WITH_IDEOGRAM_API_KEY in node 7. HTTP — Generate Image Ideogram has been replaced with your actual Ideogram API key in the Api-Key header fieldFacebook post not publishing:
REPLACE_WITH_FB_PAGE_ACCESS_TOKEN in node 9. HTTP — Post to Facebook has been replaced with a valid Page Access Token — not a User Access TokenGoogle Sheets log not updating:
Timestamp, Domain ID, Link Type, Live URLsNeed help setting this up or want a custom version built for your team or agency?
📧 Email: [email protected]
🌐 Website: https://isawow.com/