{ "id": "iA0rm7IWi7xmY5sQ", "meta": { "instanceId": "workflow-a7919df3", "versionId": "1.0.0", "createdAt": "2025-09-29T07:07:50.203074", "updatedAt": "2025-09-29T07:07:50.203134", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production" }, "name": "Get Long Lived Facebook User or Page Access Token", "tags": [ "automation", "n8n", "production-ready", "excellent", "optimized" ], "nodes": [ { "id": "2a5077ad-89ee-4659-93a9-e01bcceba0ad", "name": "When clicking ‘Test workflow’", "type": "n8n-nodes-base.manualTrigger", "position": [ 480, 280 ], "parameters": {}, "typeVersion": 1, "notes": "This manualTrigger node performs automated tasks as part of the workflow." }, { "id": "e2c7ce4c-fbf9-4552-8a9e-5b41d72c8921", "name": "Get Long Lived FB User Token", "type": "n8n-nodes-base.httpRequest", "position": [ 1000, 280 ], "parameters": { "url": "{{ $env.WEBHOOK_URL }}", "options": { "response": { "response": { "fullResponse": true } } }, "sendQuery": true, "queryParameters": { "parameters": [ { "name": " grant_type", "value": "fb_exchange_token" }, { "name": " client_id", "value": "={{ $json[' client_id'] }}" }, { "name": " client_secret", "value": "={{ $json[' client_secret'] }}" }, { "name": " fb_exchange_token", "value": "={{ $json.user_access_token }}" } ] } }, "typeVersion": 4.2, "notes": "This httpRequest node performs automated tasks as part of the workflow." }, { "id": "4e898760-43cd-4d4f-a76c-555175fb2a27", "name": "Get Long Lived FB Page Token", "type": "n8n-nodes-base.httpRequest", "position": [ 1280, 280 ], "parameters": { "url": "{{ $env.BASE_URL }}", "method": "=GET", "options": { "response": { "response": { "fullResponse": true } } }, "sendQuery": true, "queryParameters": { "parameters": [ { "name": " access_token", "value": "={{ $json.body.access_token }}" } ] } }, "typeVersion": 4.2, "notes": "This httpRequest node performs automated tasks as part of the workflow." }, { "id": "6ac48498-014f-4721-9629-acd3bd1329e7", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 640, -87.08653868552273 ], "parameters": { "width": 260.14166686078653, "height": 552.0076928452548, "content": "## Set Required Facebook Parameter \n- client_id\n- client_secret\n- user_access_token\n- app-scoped-user-id (optional)\n\n## according to this doc\n {{ $env.WEBHOOK_URL }}" }, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow." }, { "id": "11a68266-f7ec-4c56-9327-c4fd0e4478f6", "name": "Set Parameter", "type": "n8n-nodes-base.set", "position": [ 700, 280 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "b1f6b8a1-dc25-4b1e-9aa3-0c0e452ae2de", "name": " client_id", "type": "string", "value": "xxxx" }, { "id": "9a63879a-c359-49ad-9fec-19c9e4c78dd6", "name": " client_secret", "type": "string", "value": "yyyy" }, { "id": "6971a841-ed5e-4d96-bdab-1eaec2d51ccc", "name": "user_access_token", "type": "string", "value": "zzzzz" }, { "id": "c75d5e50-62ea-4ee0-bfaa-5f79cf4d147e", "name": "app_scoped_user_id", "type": "string", "value": "uuuuuu" } ] } }, "typeVersion": 3.4, "notes": "This set node performs automated tasks as part of the workflow." } ], "active": false, "pinData": {}, "settings": { "executionOrder": "v1", "saveManualExecutions": true, "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": null, "timezone": "UTC", "executionTimeout": 3600, "maxExecutions": 1000, "retryOnFail": true, "retryCount": 3, "retryDelay": 1000 }, "versionId": "390c37ce-2c9a-4341-bcb4-2f669f65e209", "connections": { "e2c7ce4c-fbf9-4552-8a9e-5b41d72c8921": { "main": [ [ { "node": "error-handler-e2c7ce4c-fbf9-4552-8a9e-5b41d72c8921", "type": "main", "index": 0 } ], [ { "node": "error-handler-e2c7ce4c-fbf9-4552-8a9e-5b41d72c8921-5c6cf023", "type": "main", "index": 0 } ], [ { "node": "error-handler-e2c7ce4c-fbf9-4552-8a9e-5b41d72c8921-6361ccf9", "type": "main", "index": 0 } ], [ { "node": "error-handler-e2c7ce4c-fbf9-4552-8a9e-5b41d72c8921-de9de840", "type": "main", "index": 0 } ], [ { "node": "error-handler-e2c7ce4c-fbf9-4552-8a9e-5b41d72c8921-e48a51dd", "type": "main", "index": 0 } ], [ { "node": "error-handler-e2c7ce4c-fbf9-4552-8a9e-5b41d72c8921-1db63a82", "type": "main", "index": 0 } ], [ { "node": "error-handler-e2c7ce4c-fbf9-4552-8a9e-5b41d72c8921-7e097325", "type": "main", "index": 0 } ], [ { "node": "error-handler-e2c7ce4c-fbf9-4552-8a9e-5b41d72c8921-5c10f43d", "type": "main", "index": 0 } ], [ { "node": "error-handler-e2c7ce4c-fbf9-4552-8a9e-5b41d72c8921-24388449", "type": "main", "index": 0 } ] ] }, "4e898760-43cd-4d4f-a76c-555175fb2a27": { "main": [ [ { "node": "error-handler-4e898760-43cd-4d4f-a76c-555175fb2a27", "type": "main", "index": 0 } ], [ { "node": "error-handler-4e898760-43cd-4d4f-a76c-555175fb2a27-8cc0ab90", "type": "main", "index": 0 } ], [ { "node": "error-handler-4e898760-43cd-4d4f-a76c-555175fb2a27-4e382961", "type": "main", "index": 0 } ], [ { "node": "error-handler-4e898760-43cd-4d4f-a76c-555175fb2a27-d594f0e1", "type": "main", "index": 0 } ], [ { "node": "error-handler-4e898760-43cd-4d4f-a76c-555175fb2a27-9a275349", "type": "main", "index": 0 } ], [ { "node": "error-handler-4e898760-43cd-4d4f-a76c-555175fb2a27-21466fe0", "type": "main", "index": 0 } ], [ { "node": "error-handler-4e898760-43cd-4d4f-a76c-555175fb2a27-fc382b3d", "type": "main", "index": 0 } ], [ { "node": "error-handler-4e898760-43cd-4d4f-a76c-555175fb2a27-39737c88", "type": "main", "index": 0 } ], [ { "node": "error-handler-4e898760-43cd-4d4f-a76c-555175fb2a27-e32cd4fb", "type": "main", "index": 0 } ] ] } }, "description": "Automated workflow: Get Long Lived Facebook User or Page Access Token. This workflow integrates 5 different services: stickyNote, httpRequest, set, stopAndError, manualTrigger. It contains 9 nodes and follows best practices for error handling and security.", "notes": "Excellent quality workflow: Get Long Lived Facebook User or Page Access Token. This workflow has been optimized for production use with comprehensive error handling, security, and documentation." }