A complete, official, Meta-compliant guide to connecting a client's Facebook Page to an n8n automation system — using only the Messenger Platform API and Webhooks. No passwords, no browser automation, no unofficial access, at any step.
- 🏗️ Architecture
- 🔒 Security & Compliance
- 🛠️ Stack
- ✅ Prerequisites
- Part A — Business Portfolio Setup
- Part B — Create a Meta Developer Account
- Part C — Create the App & Select Use Case
- Part D — Permissions, Page Connection & Access Token
- Part E — Verifying the Token Type
- Part F — Creating & Hosting a Privacy Policy
- Part G — Configuring the Webhook
- Part H — Connecting the Webhook to Automation Logic
- Part I — Publishing the App (Going Live)
- Part J — Testing & Troubleshooting
- 📋 Credentials Checklist Template
- 👤 Author
| Layer | Components |
|---|---|
| User | End user sends a message on the client's Facebook Page |
| Facebook Page | Receives & replies via Messenger — connected to a Business Portfolio & App |
| Messenger Platform | Meta's official Messenger API — delivers incoming messages, sends outgoing replies |
| Automation System | n8n — receives the webhook, runs AI/DB/API logic, prepares & sends the reply |
| External Services | AI/LLM, Database, External APIs, or other tools the workflow calls |
- ✅ Official Meta APIs only — Graph API + Messenger Platform
- ✅ No passwords, no bots, no browser automation
- ✅ Webhooks + Page Access Token — the only credentials involved
- ✅ Standard Access — no App Review or Business Verification needed, as long as the App and Page belong to the same Business Portfolio and serve only that one client
⚠️ App Review is only required when one App messages Pages that are not owned by its own Business Portfolio (e.g. one shared App serving multiple unrelated third-party clients). For a single-Page, single-client setup, Standard Access is sufficient.
| Component | Role | Purpose |
|---|---|---|
| Meta Business Portfolio | Container | Owns the client's Page + App together — enables Standard Access |
| Meta Developer Account | Access | Required to create and manage the App |
| Meta App (Business Messaging) | Bridge | Connects the Page to the Messenger Platform API |
| Graph API — Page Access Token | Credential | Authenticates all Send API requests |
| Webhook (GET + POST) | Trigger | Meta's verification handshake + incoming message delivery |
| n8n | Automation Engine | Receives the webhook, runs workflow logic, sends replies via the Send API |
| Privacy Policy (public URL) | Compliance | Required before the App can go Live |
- A Facebook account with Admin access to the client's Facebook Page
- The client's Facebook Page must already exist
- A running automation system (e.g. n8n) reachable via a public HTTPS URL (VPS + domain, or VPS + ngrok/Cloudflare Tunnel for testing)
- A web browser (Chrome recommended)
A Business Portfolio (formerly "Business Manager") is Meta's container for organizing Pages, Apps, and other business assets under one account. Every Page used for API-based messaging should be linked to a Business Portfolio that also owns the App — this is what allows Standard Access (no App Review) to work.
- Go to business.facebook.com and log in with the Facebook account that manages the client's Page.
- If no portfolio exists, click "Create a Business Portfolio" (or "Create Account").
- Enter the Business Portfolio name (matching the client's public business name), your name, and a business email address.
- Click "Submit" / "Next".
- Check the business email inbox and click the confirmation link Meta sends.
- Optionally add team members or partners with the appropriate role (Admin, Employee, Partner, or System User).
- Click "Confirm" to finish.
ℹ️ For a new client, repeat these steps using the client's own business details.
- Inside the Business Portfolio, go to "Business Settings" (gear icon).
- In the left menu: "Accounts" → "Pages".
- Click "+ Add" → "Add a Page".
- Enter the Page name or URL and click "Add Page".
- If you're an Admin of the Page, ownership is confirmed automatically or after Facebook's verification.
⚠️ This Page must stay linked to this same Business Portfolio for the entire setup — Standard Access permissions depend on this Page–Portfolio–App relationship.
- Go to developers.facebook.com.
- Log in with the same Facebook account used for the Business Portfolio.
- If prompted, register as a developer (accept terms, verify with a phone number/SMS code).
- Once registered, you'll land on the "My Apps" dashboard.
- From "My Apps", click "Create App".
- On the "Use cases" screen, click the "Business messaging" filter on the left panel.
- Select "Engage with customers on Messenger from Meta" as the use case. Do not select WhatsApp or Threads unless specifically needed.
- Click "Next".
- On the "Business" step, select the Business Portfolio that owns the client's Page (from Part A).
- Complete the "Requirements" step (App name, etc.) and continue to "Overview".
- Click "Go to Dashboard" / "Create App" to finish.
The App Dashboard will show a checklist: "Customize the Engage with customers on Messenger from Meta use case", "Test use cases", and "Check requirements & publish".
- Click "Customize the Engage with customers on Messenger from Meta use case" from the Dashboard.
- Go to the "Permissions and features" tab.
Because the Page belongs to the same Business Portfolio as the App, these should already show "Ready for testing" automatically:
pages_messagingpages_manage_metadatapages_show_listbusiness_managementpublic_profile
⚠️ Do not click "Request permission" / submit for App Review at this stage. App Review is only needed when messaging Pages not owned by this Business Portfolio. For this single-Page, single-client setup, Standard Access is enough.
- Go to the "Messenger API Settings" tab.
- Under "2. Generate access tokens", click "Connect".
- In the popup, select the client's Facebook Page and approve all requested permissions.
- Once connected, the Page appears in the list with a "Generate" link next to "Token".
- Click "Generate", then copy the full access token string.
⚠️ Store this token immediately in a secure location (password manager or the automation system's encrypted credentials store). Never hardcode it in code or share it in plain text.
Tokens generated through a Business-type App connected to a Business Portfolio are typically long-lived Page Access Tokens that don't expire — but always verify.
- Open a new tab: developers.facebook.com/tools/debug/accesstoken
- Paste the copied access token into the "Access Token" field.
- Click "Debug".
- Check the "Expires" field:
| Expires Field Shows | Meaning | Action |
|---|---|---|
Never |
Permanent token — won't expire | No action needed. Proceed to webhook setup. |
| A specific date (~60 days) | Long-lived but temporary token | Convert to a System User token in Business Settings for a permanent token, or set a reminder to regenerate before expiry. |
Meta requires a publicly accessible Privacy Policy URL before an App can go Live. It must be a genuine page describing what user data is collected and how it's used — not an internal tool link or webhook URL.
At minimum, describe:
- What data is collected (name, profile picture, PSID, message content)
- Why it's collected (customer support, order status, lead handling)
- Whether data is shared with third parties (e.g. AI providers like OpenAI/Anthropic, if applicable)
- How long data is retained and how it's protected
- How a user can request data deletion, and contact information
Any of these free options work:
- Notion — create a page, paste the policy text, then "Share" → "Publish" for a public
*.notion.siteURL - Google Sites — build a simple one-page site and publish it
- GitHub Pages — host a static HTML page (most reliable, recommended for production)
- The client's own website, under a
/privacy-policypath, if available
⚠️ Always test the final published URL in an incognito/private window to confirm it's viewable without logging in — this is exactly how Meta's review system checks it.
- In n8n, create a new workflow and add a Webhook node.
- Set the HTTP Method to accept both GET (Meta's verification handshake) and POST (incoming messages). Use the same Path for both if separate nodes are required.
- Add a "Respond to Webhook" node after the Webhook node.
- Configure the response:
Respond With= Text,Response Body= the expression returning the incominghub.challengequery parameter,Response Code= 200. - Save the workflow and toggle it Active.
- Open the Webhook node and copy the Production URL (not the Test URL) — it only works while the workflow is Active.
- In the Meta App Dashboard: Messenger API Settings → "1. Configure webhooks".
- Paste the n8n Production URL into "Callback URL".
- Enter a custom "Verify token" — any random secure string you create yourself. Keep a copy.
- Click "Verify and Save".
- On success, a green checkmark appears next to both "1. Configure webhooks" and "2. Generate access tokens".
- Under "1. Configure webhooks", enable at minimum:
messagesandmessaging_postbacks. - Under "2. Generate access tokens", next to the connected Page, click "Add Subscriptions" and confirm the same fields are subscribed for that specific Page.
- Extend the n8n workflow: after the Webhook (POST) trigger, parse the incoming JSON to extract the sender PSID and message text.
- Route the extracted data into your automation/AI logic (AI response generator, database lookup, rules engine, etc.).
- Use an HTTP Request node to send the reply back via the Send API:
POST https://graph.facebook.com/v21.0/me/messages?access_token={PAGE_ACCESS_TOKEN}
Body: { "recipient": {"id": "{sender_psid}"}, "message": {"text": "..."} }
- Test by sending a real message to the Page from a personal account and confirm the automated reply is received.
While the App is in Development Mode, only accounts with an Admin, Developer, or Tester role on the App can send/receive messages. Publishing is required so any real customer messaging the Page triggers the automation.
- From the App Dashboard, click "Publish" in the left sidebar.
- Fill in required fields: App Icon, Category, and the Privacy Policy URL (from Part F).
- Review and confirm any remaining checklist items (e.g. Data Use Checkup, if applicable).
- Click "Publish" to switch the App from Development to Live mode.
✅ Because permissions for this Page were already Standard Access ("Ready for testing"), publishing does not require a formal App Review submission for this use case — just the basic app info above.
- From an account that is not an Admin/Developer/Tester on the App, send a message to the client's Page.
- Confirm the message appears in n8n's Executions log.
- Confirm the automated reply is received back in Messenger.
| Symptom | Likely Cause | Fix |
|---|---|---|
| Webhook verification fails | n8n workflow not Active, or Test URL used instead of Production URL | Activate the workflow; use the Production URL |
| No data reaching n8n at all | Tunnel (ngrok) not running, or Page not subscribed to the App | Check ngrok status at 127.0.0.1:4040; re-subscribe the Page's webhook fields |
| Only your own messages trigger the bot | App still in Development Mode | Publish the App (Part I) |
| Token stopped working after ~60 days | A long-lived (non-permanent) token was used instead of a System User token | Regenerate via System User in Business Settings for a non-expiring token |
| Privacy Policy page shows blank | Publishing not fully propagated, or an ad-blocker is interfering | Wait a few minutes, test in incognito mode, try another device |
Use this checklist for every new client onboarded onto the Messenger automation system.
| Item | Value / Status | Notes |
|---|---|---|
| Client / Business Name | ||
| Business Portfolio ID | ||
| Facebook Page Name | ||
| Facebook Page ID | ||
| Meta App Name | ||
| Meta App ID | ||
| Page Access Token | Store securely; confirm "Never" expiry via Debugger | |
| Webhook Callback URL | ||
| Webhook Verify Token | ||
| Privacy Policy URL | ||
| App Publish Status | Development / Live | |
| n8n Workflow Name |

