Skip to content

How to Integrate Facebook Graph API with n8n: A Complete Guide

If you want to automate Facebook Page management—posting updates, reading feeds, managing comments—using n8n and Facebook Graph API, this guide walks you through the entire process. From setting up your Facebook app and getting the right permissions to creating your first post using n8n, you’ll learn exactly what you need.


Why Use Facebook Graph API with n8n?

Facebook Graph API is the official way to interact programmatically with Facebook Pages, Groups, and user profiles. n8n is a powerful automation tool that can help you build workflows to automate tasks like:

  • Posting updates automatically
  • Reading and processing comments
  • Managing Page insights and analytics

Step 1: Understand Facebook Permissions & Use Cases

Before diving in, understand the permissions your app needs. Different tasks require different scopes:

TaskRequired Permissions
Read Page info and postspages_show_list, pages_read_engagement
Post content to Page feedpages_manage_posts, pages_read_engagement
Manage commentspages_manage_engagement
Access Page insightspages_read_engagement

Make sure you request the minimum necessary permissions to keep your app simple and compliant.


Step 2: Create and Configure Your Facebook App

  1. Go to the Facebook Developers Console
  2. Create a new app (select type "Business" or related)
  3. Add Facebook Login if you want user authentication flow
  4. Add Facebook Pages API access
  5. Fill in required details like Privacy Policy URL, App Domains, and contact info
  6. Set up app roles (admins, developers, testers) to control who can test before review

Step 3: Generate Access Tokens with the Right Permissions

a. Get a User Access Token

Use the Graph API Explorer to:

  • Select your app
  • Click Get User Access Token
  • Select these permissions:
    • pages_show_list
    • pages_read_engagement
    • pages_manage_posts
  • Accept Facebook’s permission dialog and generate the token

b. Get the Page Access Token

With the User Access Token, call:

http
GET https://graph.facebook.com/v24.0/me/accounts?access_token=USER_ACCESS_TOKEN

The response includes the pages you manage, plus their Page Access Tokens.

Use the Page Access Token for any further calls to manage the page.

Step 4: Test Facebook API Calls Manually

Before automating with n8n, test your calls using the Graph API Explorer or curl:

  • List page feed:

      GET /{page-id}/feed?access_token=PAGE_ACCESS_TOKEN
    
  • Post a message:

      POST /{page-id}/feedmessage=Hello from n8n!access_token=PAGE_ACCESS_TOKEN
    

You should receive a post ID confirming your post was successful.


Step 5: Submit Your App for Facebook Review (If Needed)

If you want to go live with users other than admins or testers:

  • Submit your app for review in the Facebook Developer Dashboard
  • Request the permissions you use (pages_manage_posts, pages_read_engagement, etc.)
  • Provide Facebook with a clear explanation, screencast, and test users for validation
  • After approval, your app can be used publicly

Step 6: Automate Posting in n8n

Now that your app and tokens are ready, configure an HTTP Request node in n8n:

FieldValue
HTTP MethodPOST
URLhttps://graph.facebook.com/v24.0/{page-id}/feed (replace {page-id})
AuthenticationNone (pass token manually)
Body Content TypeForm URL-Encoded
Body Parametersmessage: Your post text
access_token: Your Page Access Token

Example n8n Workflow JSON Snippet:

{ "nodes": [ { "parameters": { "httpMethod": "POST", "url": "https://graph.facebook.com/v24.0/763374396870113/feed", "bodyContentType": "form-url-encoded", "bodyParametersUi": { "parameter": [ { "name": "message", "value": "Hello world from n8n!" }, { "name": "access_token", "value": "YOUR_PAGE_ACCESS_TOKEN" } ] } }, "name": "Post to Facebook Page", "type": "httpRequest", "typeVersion": 1, "position": [450, 300] } ]}

Step 7: Best Practices

  • Always use the Page Access Token (never the User Access Token) when interacting with pages.
  • Handle token expiration by using long-lived tokens or automating token refresh.
  • Store your tokens securely (n8n Credentials or environment variables).
  • Test all calls first in Graph API Explorer before automating.
  • Respect Facebook API rate limits and permissions policies.

Summary

By carefully managing Facebook app permissions and tokens, and configuring your n8n workflow correctly, you can fully automate Facebook Page management tasks — posting updates, reading feeds, and more.

If you follow this guide, you’ll avoid common pitfalls like permission errors, expired tokens, or invalid API paths.