How To Post to Facebook Via N8N [AI Automation]

Automating Facebook posts can save you time and boost your productivity — especially if you’re working with AI agents. In this blog post, I’ll guide you step-by-step on how you can connect N8n with Facebook to automatically post content on your Facebook pages.

Let’s dive right into it!


Step 1: Prepare Your Accounts

Before starting:

  • Make sure you have an account on developers.facebook.com.
  • Install N8n locally on your machine.
    (If you’re new to N8n, you can check our beginner-friendly guide on installing N8n without cloud charges.)

Step 2: Create a New App on Facebook Developer Portal

  1. Visit developers.facebook.com.
  2. Click “My Apps” > “Create App”.
  3. App Name: Enter a name (e.g., “Connect with N8n”).
  4. Email: Add your contact email.
  5. Click Next.

Important Selections:

  • Type: Choose Other.
  • Business: Choose Business.
  • Select your business account if you have one (optional), otherwise skip.
  1. After filling in details, click Create App.
  2. Complete any verification steps if prompted (e.g., entering your Facebook password).

Step 3: Add Webhooks Product to Your App

  1. Inside your newly created app, scroll down to “Add Products to Your App”.
  2. Find Webhooks and click Set Up.

You don’t need to configure anything here immediately. We’ll handle the Webhooks later if needed.


Step 4: Update App Settings

  1. Navigate to Settings > Basic inside your App dashboard.
  2. Add a Privacy Policy URL (you can use your website URL if you don’t have a specific policy page).
  3. Click Save Changes.
  4. Switch your app status from Development to Live by toggling it ON.

Now your app is ready to generate tokens!


Step 5: Generate an App Access Token

  1. Go to Tools > Graph API Explorer in Facebook Developers portal.
  2. Select your newly created app from the dropdown menu.
  3. Add the following permissions:
    • pages_manage_posts
    • pages_read_engagement
    • pages_read_user_content
    • pages_show_list
    • pages_events
  4. Click Generate Access Token.
  5. A popup will appear asking for permissions. Allow the required permissions for your pages.
  6. Once authorized, copy the generated Access Token.

Step 6: Connect Facebook with N8n

  1. Open your N8n workflow editor.
  2. Create a new Facebook Graph API Node.
  3. Click the pencil icon near the credentials section.
  4. Choose Create New Credentials.
  5. In the credentials form, paste the Access Token you copied earlier.
  6. Save the credentials.

Now your N8n is officially connected to your Facebook account!


Step 7: Test Your Connection (Optional)

To ensure everything is working:

  • Create a small test workflow.
  • Use Facebook Graph API Node to publish a test post to one of your pages.
  • Run the workflow.
  • Check your Facebook page to see if the post appears.

Final Words

Congratulations! 🎉
You have successfully connected N8n with Facebook for auto posting. Now you can create smart agents that post automatically based on your triggers, schedules, or any custom workflows.

In the next blog, we’ll cover how to build a complete AI content machine that auto-posts on LinkedIn, Facebook, and X (formerly Twitter)!

Stay tuned! 🚀

Vote Here

About

Leave a Comment

Your email address will not be published. Required fields are marked *