n8n Social Media Meta API
12 min read Automation

How to Connect Facebook & Instagram to n8n Using the Meta Graph API

Struggling with manual social media posting? The Meta Graph API integration with n8n lets you automate posting to Facebook and Instagram business accounts - but setting it up can be frustrating. This step-by-step guide walks you through the entire process, from creating your Meta developer app to generating long-lived access tokens.

Business Account Requirements

Before you can automate posting to Facebook and Instagram through n8n, you need the right type of accounts. The Meta Graph API only works with business accounts - personal accounts won't work for automation. This is a security measure by Meta to prevent misuse of their platforms.

You'll need three things before starting the integration process: a Facebook Business Manager account, a Facebook business page, and an Instagram business account. If you're currently using personal accounts, you'll need to convert them to business accounts first.

Important: Your Instagram account must be connected to your Facebook page through Meta Business Suite. You can verify this connection by going to Settings > Instagram accounts in your Business Manager.

Creating Your Meta Developer App

The first technical step is creating a developer app in the Meta for Developers portal. This app will serve as the bridge between n8n and your Facebook/Instagram accounts. While the interface changes frequently, the core requirements remain the same.

Navigate to developers.facebook.com and go to "My Apps". Click "Create App" and select "Business" as the app type. You'll need to provide your business email, a privacy policy URL, and terms of service URL. These don't need to be complex - you can use simple pages on your website.

Critical step: Before your app will work, you must verify your business in Meta Business Suite. This involves submitting business documentation and can take 1-3 days to complete.

Setting Up Required Permissions

Meta's API uses a permissions system to control what your app can do. For basic posting functionality, you need to request specific permissions in the Graph API Explorer. Missing any of these will prevent your automation from working.

For Facebook, you need: page_manage_posts, pages_messaging, pages_read_engagement, pages_read_user_content, pages_show_list, and pages_manage_events. For Instagram, you need: instagram_basic, instagram_content_publish, instagram_comments, and instagram_insights.

Pro tip: Always select "business_management" permission - this is required for the token extension process later and many users miss it.

Generating Your Access Token

The access token is your key to the Meta API - it authenticates your requests. You generate this in the Graph API Explorer after selecting all necessary permissions. The initial token you get will only last one hour.

After generating the token, test it by making a simple API call to post to your Facebook page. In n8n, create a new Facebook Graph API node and paste your token. Set the node to "me" and edge to "feed" for a basic text post test.

Note: The one-hour token is just for testing - we'll extend it to 60 days in the next section. Don't build your automation with short-lived tokens.

Extending Your Access Token

Short-lived tokens are useless for automation, so we need to extend them. Use the Access Token Debugger tool to convert your one-hour token into a 60-day token. This requires entering your Facebook password for security.

The debugger shows your token's expiration date and permissions. Click "Extend Access Token" and authenticate. The new long-lived token will appear at the bottom - copy this into your n8n configuration.

Important: Even 60-day tokens expire. For production use, you'll need a system to automatically refresh tokens before they expire. GrowwStacks can help set this up.

Finding Your Facebook & Instagram IDs

To post different content types, you need your specific account IDs. These aren't your usernames - they're numeric identifiers used by the API. Each platform has its own ID location.

For Facebook, use the Graph API Explorer to query "me/accounts" - this returns your page ID. For Instagram, go to Meta Business Suite > Settings > Instagram accounts to find your numeric ID. These IDs go in your n8n node configurations.

Remember: The node ID field in n8n changes based on content type - use your user ID for text posts, page ID for photos/videos.

Posting Different Content Types

The Meta Graph API handles different content types through "edges" - specific endpoints for each media type. In n8n, you configure these by changing the edge parameter in your Facebook Graph API node.

For text posts: node = your user ID, edge = feed. For photos: node = your page ID, edge = photos. For videos: node = your page ID, edge = videos. Each requires slightly different parameters in the request body.

Implementation tip: Create separate n8n nodes for each content type in your workflow. This keeps your automation clean and makes troubleshooting easier.

Watch the Full Tutorial

For a complete walkthrough of the entire process with live demonstrations, watch our full video tutorial. At 12:45 in the video, we show how to troubleshoot common webhook verification issues that often block progress.

Video tutorial: Connecting Facebook and Instagram to n8n using Meta Graph API

Key Takeaways

Connecting Facebook and Instagram to n8n through the Meta Graph API opens powerful automation possibilities, but the setup process has several precise steps that must be followed correctly. The most common pitfalls are missing permissions, unverified business accounts, and using short-lived tokens.

In summary: 1) Use business accounts, 2) Create a Meta developer app, 3) Set all required permissions, 4) Generate and extend your access token, 5) Find your account IDs, and 6) Configure n8n nodes with the correct edges for each content type.

Frequently Asked Questions

Common questions about this topic

The Meta Graph API only works with business accounts, not personal accounts. This is a security measure by Meta to prevent misuse of their platform.

Business accounts provide additional features and analytics that personal accounts don't have. The API restrictions help Meta maintain platform integrity while allowing legitimate business use cases.

  • Convert personal accounts to business accounts in account settings
  • Instagram business accounts must be connected to a Facebook page
  • Business verification may be required for certain API features

The initial access token only lasts for one hour, but you can extend it to 60 days using the token debugger tool.

After 60 days, you'll need to generate a new token. This is why we recommend setting up a system to automatically refresh tokens before they expire.

  • Short-lived token: 1 hour validity
  • Long-lived token: 60 days validity
  • No permanent tokens available through basic API access

For basic posting functionality, you need page_manage_posts, pages_messaging, pages_read_engagement, pages_read_user_content, pages_show_list, and pages_manage_events permissions.

For Instagram, you'll need instagram_basic, instagram_content_publish, instagram_comments, and instagram_insights permissions. Always include business_management permission for token extension.

  • Facebook permissions control page access
  • Instagram permissions control content publishing
  • Missing permissions will cause API calls to fail

Webhook verification failures are usually due to incorrect callback URLs or verification tokens.

Make sure your n8n webhook URL is correctly copied and that your verification token matches exactly between Facebook and n8n. Also ensure your business account is verified.

  • Check for typos in callback URLs
  • Verify tokens must match exactly
  • Business verification is required for webhooks

You can find your Instagram business account ID in Meta Business Suite under Settings > Instagram accounts.

This ID is different from your Instagram username and is required for API integrations. It's a numeric value that identifies your account to the API.

  • Not the same as your @username
  • Required for all Instagram API calls
  • Found in Meta Business Suite settings

Yes, but you need to use different edge parameters in your API calls. For photos, use the 'photos' edge with your page ID as the node.

For videos, use the 'videos' edge. Text-only posts use the 'feed' edge with your user ID as the node. Each content type has slightly different required parameters.

  • Photos: node=pageID, edge=photos
  • Videos: node=pageID, edge=videos
  • Text: node=userID, edge=feed

A short-lived token lasts only 1 hour and is what you initially get from the Graph API Explorer. A long-lived token lasts 60 days and is obtained by exchanging your short-lived token.

Neither type is permanent, so you'll need a system to refresh them. Long-lived tokens are essential for automation as they don't require daily manual renewal.

  • Short-lived: 1 hour, for testing
  • Long-lived: 60 days, for production
  • Both require periodic refresh

GrowwStacks specializes in building custom automation solutions using n8n and other platforms. We can set up your Meta Graph API integration, create automated posting workflows, and handle token refresh systems so you don't have to.

Our team will ensure your social media automation runs smoothly while complying with all Meta platform requirements. We handle the technical setup so you can focus on creating content.

  • Full API integration setup - we handle all the technical details
  • Automated token refresh systems
  • Custom posting workflows tailored to your content calendar

Let Us Handle Your Social Media Automation

Manually posting to multiple platforms wastes hours each week. Our n8n experts will build you a custom automation system that posts to Facebook and Instagram on your schedule.