Get long-lived Facebook Page access tokens and subscribe Messenger webhook fields via Graph API
Ready for 3.0What this workflow does
This workflow has 11 nodes and runs manually, when you click “Execute workflow”. It uses only n8n's built-in nodes. It also calls graph.facebook.com over HTTP.
How it runs
Trigger: Manually, when you click “Execute workflow”.
- Needed Value (Edit Fields (Set)): sets 4 fields: app_id, app_secret, short_user_access_token…
- Get long-lived user access token (HTTP Request): calls graph.facebook.com
- Get app scoped user id (HTTP Request): calls an HTTP API
- Get long-lived page access token (HTTP Request): calls an HTTP API
- Split Out: splits a list into separate items
- Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
- GET Current Fields (HTTP Request): calls an HTTP API
- Merge Fields (Code): runs custom JavaScript code
- POST Merged Fields (HTTP Request): calls an HTTP API (POST)
- Wait: waits 1 seconds
HTTP calls to: graph.facebook.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (7)
- Manual Trigger
n8n-nodes-base.manualTrigger - Edit Fields (Set)
n8n-nodes-base.set - HTTP Request
n8n-nodes-base.httpRequest - Split Out
n8n-nodes-base.splitOut - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Code
n8n-nodes-base.code - Wait
n8n-nodes-base.wait
From the author
Get Long-Lived Facebook Page Access Token and Subscribe Messenger Webhook Fields This n8n template automates two critical one-time setup steps required before any Facebook automation can go live: it exchanges a short-lived User Access Token for a long-lived…