An n8n workflow that researches, drafts, and publishes Facebook posts on a schedule or on-demand — with a human approval step and built-in duplicate-content detection.
- Triggers on a 12-hour schedule or an on-demand Telegram message
- Authenticates incoming Telegram messages against an allow-listed chat ID; everything else is silently ignored
- Researches a current, relevant news item or statistic via SerpApi before writing
- Generates a post with an LLM agent (GPT-4.1), following a fixed voice/structure/length spec
- Checks for duplicates against the last 20 published posts (stored in workflow static data) — both an exact-text pass and a "same opening hook" pass
- Sends the draft to Telegram for approval, flagging any possible duplicate, with a 24-hour response window
- Publishes to Facebook via the Zernio API (Previously Late API) only after approval, then logs the post to history
- Notifies you on Telegram for every outcome: published, rejected, or failed to publish
Trigger (Telegram msg OR schedule)
→ Auth check (Telegram only)
→ Normalize input
→ Load recent post history
→ Generate post (LLM agent + news search tool)
→ Duplicate check
→ Send to Telegram for approval
→ Approved → Publish to Facebook → Log to history → Notify success
→ Rejected → Notify rejection
→ Publish error → Notify failure (post text included so you can post manually)
- An n8n instance (cloud or self-hosted) with LangChain nodes enabled
- API credentials for:
- OpenAI (post generation)
- Telegram Bot API (approval flow + notifications)
- SerpApi (news/trend search)
- Late API (Facebook publishing) — or swap in your own Facebook-publishing node/integration
- Import
autopost_facebook.jsoninto n8n. - Attach your own credentials to each node that references one (OpenAI, Telegram, SerpApi, Late).
- Replace every occurrence of
YOUR_TELEGRAM_CHAT_IDwith your personal Telegram chat ID:If Chat Authorized(the comparison value)Notify Published,Notify Rejected,Notify Publish Failed,Request Approval(thechatIdfield)
- Replace
YOUR_FACEBOOK_ACCOUNT_IDin theCreate postnode with your Late-connected Facebook page/account ID. - Adjust the system prompt in
Generate Facebook Postto match your niche, tone, and posting themes — it currently defaults to an AI-automation-agency voice. - Activate the workflow.
To trigger a post on demand, just message your Telegram bot from the authorized chat.
Recent posts are stored in n8n's built-in workflow static data — no external database required. This is fine for single-instance, moderate-volume use, but it's tied to this specific workflow's JSON. If you plan to duplicate or version this workflow, or want persistent analytics, swap the storage for Airtable, Postgres, or Google Sheets. Future commits will work on this.
The Create post node uses continueErrorOutput, so a failed Facebook publish doesn't crash the run — it instead sends you a Telegram alert with the full post text so you can publish manually if needed.
The generation prompt (system message on Generate Facebook Post) controls topic themes, tone, structure, and constraints (no fake stats, no hard-sell language, etc.). Edit it directly to fit your brand.
Built together with Abdelrahman TC — thanks for your help.
MIT — see LICENSE.

