Facebook Page Integration for n8n - Easy API Integration Made Simple
The easiest way to integrate Facebook with n8n! 🚀 No complex API setup required - we've simplified Facebook Graph API integration for n8n users.
A comprehensive n8n Facebook node with enhanced AI Agent logging. Create posts, manage comments, send messages, get insights, handle events, upload media, and set up real-time triggers with OAuth2 authentication and robust error handling.
🎯 Perfect for n8n Users Looking For:
- Facebook automation in n8n - Complete social media workflow automation
- Easy Facebook API integration - No technical expertise required
- n8n Facebook posting - Automated content publishing
- Facebook Graph API for n8n - Full API coverage made simple
- Social media automation - Multi-platform content management
- Facebook bot for n8n - AI-powered customer engagement
- n8n community node - Ready-to-use Facebook integration
👨💻 Created By
- Developer: Umair Abubakkar - n8n automation expert
- Company: AI Wala - AI & Automation Solutions
🚀 Quick Installation
Method 1: n8n Community Nodes (Recommended) 🎯
Step-by-step installation via n8n interface:
Open n8n Settings
- Click on Settings in the left sidebar
- Navigate to Community nodes
Install the Package
- Click the Install button (top right)
- Enter package name:
@umairabubakkar/n8n-nodes-private-fb
- Click Install
Wait for Installation
- n8n will download and install the package
- You'll see the package listed with version number
- Status will show as installed
Restart n8n (if required)
- Some installations may require n8n restart
- Refresh your browser after restart
Verify Installation
- Go to your workflow
- Click Add Node (+)
- Search for "Facebook"
- You should see: Facebook Page Actions, Facebook Page Trigger, Facebook Tool
📱 Visual Installation Guide
What you'll see in n8n Community Nodes:
Community nodes
┌─────────────────────────────────────────────────────────────┐
│ @umairabubakkar/n8n-nodes-private-fb v2.0.0 │
│ 3 nodes: Facebook Page Actions, Facebook Page Trigger, │
│ Facebook Tool [Update] │
└─────────────────────────────────────────────────────────────┘
Available Nodes after installation:
- 🔧 Facebook Page Actions - Main operations (posts, comments, messages)
- ⚡ Facebook Page Trigger - Real-time events (webhooks, polling)
- 🤖 Facebook Tool - AI Agent integration with enhanced logging
Method 2: npm Installation 💻
npm install @umairabubakkar/n8n-nodes-private-fb
Method 3: Docker Installation 🐳
Add to your package.json
or install via npm in your Docker container:
RUN npm install @umairabubakkar/n8n-nodes-private-fb
⚡ Quick Start After Installation
1. Set up Facebook Credentials
- Go to n8n Credentials
- Click Add Credential
- Search for Facebook OAuth2 API
- Enter your Facebook App ID and Secret
- Click Connect my account and authorize
2. Create Your First Facebook Post
- Add Node → Search "Facebook" → Facebook Page Actions
- Select Credential → Choose your Facebook OAuth2 credential
- Configure:
- Resource: Post
- Operation: Create Text Post
- Page: Select your Facebook page
- Message: "Hello from n8n! 🚀"
- Execute → Your post will be published!
3. Set up Real-time Triggers (Optional)
- Add Node → Facebook Page Trigger
- Configure:
- Page: Select your Facebook page
- Trigger On: New Comment (or New Post, New Message)
- Trigger Method: Webhook (recommended)
- Save workflow → Copy webhook URL to Facebook App
4. AI Agent Integration (Advanced)
- Add Node → Facebook Tool
- Configure:
- Page: Select your Facebook page
- Action Preset: Community Manager
- Enable Enhanced Logging: true
- Connect to AI Agent → Use with n8n AI Agent nodes
📋 Table of Contents
- Features
- Nodes Overview
- Installation & Setup
- Facebook App Configuration
- Node Configurations
- API Operations
- AI Agent Integration
- Workflows & Examples
- Troubleshooting
- Keywords & SEO
✨ Features
Core Functionality
- Complete Facebook API Coverage: Posts, Comments, Messages, Insights, Events, Media, Page Info
- Multiple Post Types: Text, Photo, Video, Link, Scheduled, Background Text Posts
- Advanced Comment Management: Text comments, Image comments, Replies, Moderation
- Messenger Integration: Send text/image messages, Handle conversations
- Real-time Triggers: Webhooks and Polling for instant notifications
- Media Management: Upload photos/videos, Handle binary data
- Analytics & Insights: Page insights, Post analytics, Performance metrics
AI Agent Features
- Enhanced Logging: Structured logging visible in n8n AI Agent interface
- Action Presets: Pre-configured action sets for different roles
- Security Controls: Restrict actions available to AI agents
- Execution Tracking: Full context tracking with timestamps and performance metrics
- Error Context: Detailed error information with troubleshooting guidance
- Result Formatting: Optimized result display for AI Agent conversations
Technical Features
- OAuth2 Authentication: Secure Facebook login with automatic token management
- Multi-tier Upload System: 3-tier fallback system for reliable image uploads
- Binary Data Support: Handle images from previous nodes or base64 data
- Comprehensive Error Handling: Detailed error messages with resolution guidance
- Rate Limit Awareness: Built-in Facebook API rate limit handling
- Input Validation: Client-side validation to prevent common mistakes
🔧 Nodes Overview
1. Facebook Page Actions
Main node for Facebook operations
- Resources: Post, Comment, Message, Conversation, Insights, Media, Event
- Operations: Create, Read, Update, Delete operations for each resource
- Use Cases: Content management, Community engagement, Analytics
2. Facebook Page Trigger
Real-time event monitoring
- Trigger Types: New Post, New Comment, New Message, Page Mention
- Methods: Webhook (real-time) or Polling (scheduled)
- Use Cases: Automated responses, Content moderation, Customer support
3. Facebook Tool (AI Agent)
AI Agent integration with enhanced logging
- Action Presets: Content Creator, Community Manager, Analytics, Customer Support
- Security: Action restrictions and permission validation
- Use Cases: AI-powered social media management, Automated customer service
🛠 Installation & Setup
Step 1: Install the Package
Option 1: npm (Recommended)
npm install @umairabubakkar/n8n-nodes-private-fb
Option 2: n8n Community Nodes
- Go to n8n Settings → Community Nodes
- Install:
@umairabubakkar/n8n-nodes-private-fb
- Restart n8n
Step 2: Restart n8n
# If using Docker
docker restart n8n
# If using npm/yarn
npm restart
# or
yarn restart
📱 Complete Facebook App Setup Guide
Step 1: Create Facebook Developer Account
Visit Facebook Developers
- Go to developers.facebook.com
- Log in with your Facebook account
- Accept Developer Terms if prompted
Create New App
- Click "Create App" button
- Select "Business" → Click "Next"
- Fill in details:
- App Name: "n8n Facebook Integration" (or your preferred name)
- App Contact Email: Your email address
- Business Account: Select or create one
- Click "Create App"
Step 2: Configure App Basic Settings
Get App Credentials
- In your app dashboard, go to App Settings → Basic
- You'll see:
- App ID:
1234567890123456
(copy this) - App Secret: Click "Show" → Copy the secret
- App ID:
- Important: Keep these credentials secure!
Configure App Domains
- In App Domains field, add:
your-n8n-domain.com
- For localhost testing:
localhost
- In App Domains field, add:
Step 3: Add Facebook Login Product
Add Facebook Login
- In left sidebar → Add Product
- Find Facebook Login → Click "Set Up"
- Choose "Web" platform
Configure OAuth Redirect URIs
- Go to Facebook Login → Settings
- In Valid OAuth Redirect URIs, add:
https://your-n8n-domain.com/rest/oauth2-credential/callback
- For localhost testing:
http://localhost:5678/rest/oauth2-credential/callback
Step 4: Request Required Permissions
Add Permissions (Go to App Review → Permissions and Features)
- pages_manage_posts - Create and manage posts ✅
- pages_read_engagement - Read post engagement data ✅
- pages_show_list - List user's pages ✅
- pages_messaging - Send messages via Messenger ✅
- pages_messaging_subscriptions - Receive messages ✅
- read_insights - Access page insights ✅
App Review Process
- For basic testing: Use Development Mode (no review needed)
- For production: Submit for App Review (required for public use)
Step 5: Connect to n8n
Create n8n Credentials
- In n8n, go to Credentials
- Click "Add Credential"
- Search for "Facebook OAuth2 API"
- Fill in the form:
- Client ID: Paste your Facebook App ID (from Step 3)
- Client Secret: Paste your Facebook App Secret (from Step 3)
Connect Your Account
- Click "Connect my account"
- You'll be redirected to Facebook
- Log in with your Facebook account
- Authorize the app (grant all requested permissions)
- You'll be redirected back to n8n
- Status should show "Connected" ✅
Step 6: Verify Connection
- Test the Connection
- Create a new workflow
- Add Facebook Page Actions node
- Select your credential
- In Page dropdown, you should see your Facebook pages
- If pages appear → Connection successful! 🎉
🔧 Visual Guide: Facebook Developer Console
What you'll see in Facebook Developer Console:
App Dashboard
┌─────────────────────────────────────────────────────────┐
│ App ID: 1234567890123456 │
│ App Secret: •••••••••••••••••••••••••••••••• [Show] │
│ Display Name: n8n Facebook Integration │
│ Namespace: your-app-namespace │
└─────────────────────────────────────────────────────────┘
What you'll see in n8n Credentials:
Facebook OAuth2 API Credential
┌─────────────────────────────────────────────────────────┐
│ Client ID: 1234567890123456 │
│ Client Secret: •••••••••••••••••••••••••••••••••••••• │
│ [Connect my account] │
│ Status: ✅ Connected │
└─────────────────────────────────────────────────────────┘
🔐 Node Configurations
Facebook OAuth2 API Credentials
Create Credentials in n8n
- Type: "Facebook OAuth2 API"
- Client ID: Your Facebook App ID
- Client Secret: Your Facebook App Secret
Connect Account
- Click "Connect my account"
- Authorize with Facebook
- Grant all requested permissions
Facebook Page Actions Configuration
{
"resource": "post",
"operation": "createTextPost",
"pageId": "your-page-id",
"message": "Hello from n8n! 🚀"
}
Facebook Page Trigger Configuration
{
"pageId": "your-page-id",
"triggerOn": "newPost",
"triggerMethod": "webhook",
"verifyToken": "your-verify-token"
}
Facebook Tool (AI Agent) Configuration
{
"pageId": "your-page-id",
"actionPreset": "community_manager",
"enableEnhancedLogging": true
}
📊 API Operations
Posts Operations
Create Text Post
{
"resource": "post",
"operation": "createTextPost",
"message": "Your post content here"
}
Create Photo Post
{
"resource": "post",
"operation": "createPhotoPost",
"inputType": "url",
"imageUrl": "https://example.com/image.jpg",
"caption": "Photo caption"
}
Create Video Post
{
"resource": "post",
"operation": "createVideoPost",
"videoInputType": "url",
"videoUrl": "https://example.com/video.mp4",
"videoDescription": "Video description"
}
Create Link Post
{
"resource": "post",
"operation": "createLinkPost",
"linkUrl": "https://example.com",
"linkMessage": "Check this out!"
}
Create Scheduled Post
{
"resource": "post",
"operation": "createScheduledPost",
"message": "Scheduled content",
"scheduledPublishTime": "2024-12-31T12:00:00Z"
}
Create Text Post with Background
{
"resource": "post",
"operation": "createTextPostWithBackground",
"backgroundPostMessage": "Stylish text",
"textFormatPresetId": "1777259169190672"
}
Comments Operations
Get Comments
{
"resource": "comment",
"operation": "getComments",
"commentPostId": "post-id",
"limit": 25
}
Create Comment
{
"resource": "comment",
"operation": "createComment",
"commentPostId": "post-id",
"commentMessage": "Great post!"
}
Create Comment with Image
{
"resource": "comment",
"operation": "createCommentWithImage",
"commentPostId": "post-id",
"imageInputType": "url",
"imageUrl": "https://example.com/image.jpg",
"commentMessage": "Check this out!"
}
Messages Operations
Send Text Message
{
"resource": "message",
"operation": "sendTextMessage",
"recipientId": "user-id",
"messageText": "Hello! How can I help you?"
}
Send Image Message
{
"resource": "message",
"operation": "sendImageMessage",
"recipientId": "user-id",
"imageUrl": "https://example.com/image.jpg"
}
Insights Operations
Get Page Insights
{
"resource": "insights",
"operation": "getPageInsights",
"metric": "page_impressions",
"period": "day"
}
Get Post Insights
{
"resource": "insights",
"operation": "getPostInsights",
"postId": "post-id",
"metric": "post_impressions"
}
Media Operations
Upload Photo
{
"resource": "media",
"operation": "uploadPhoto",
"inputType": "url",
"imageUrl": "https://example.com/image.jpg",
"published": false
}
Upload Video
{
"resource": "media",
"operation": "uploadVideo",
"videoInputType": "url",
"videoUrl": "https://example.com/video.mp4",
"videoDescription": "Uploaded video"
}
Events Operations
Create Event
{
"resource": "event",
"operation": "createEvent",
"eventName": "Community Meetup",
"eventStartTime": "2024-12-31T18:00:00Z",
"eventDescription": "Join us for a great meetup!"
}
🤖 AI Agent Integration
Action Presets
All Actions (Default)
- Full access to all Facebook operations
- Best for: Development and testing
Content Creator
[
'create_text_post',
'create_photo_post',
'create_video_post',
'create_link_post',
'upload_photo',
'upload_video',
'create_event',
'get_posts',
'get_post',
'get_page_info'
]
Community Manager
[
'create_text_post',
'get_posts',
'get_post',
'get_comments',
'create_comment',
'create_comment_with_image',
'delete_comment',
'get_page_insights',
'send_text_message',
'get_page_info'
]
Analytics Only
[
'get_posts',
'get_post',
'get_comments',
'get_page_insights',
'get_post_insights',
'get_page_info',
'get_events'
]
Customer Support
[
'get_comments',
'create_comment',
'create_comment_with_image',
'send_text_message',
'send_image_message',
'get_page_info',
'get_posts',
'get_post'
]
AI Agent Logging
Enhanced Logging Output
✅ Text post created successfully!
📝 Post ID: 123456789_987654321
💬 Message: Hello from AI Agent!
🔗 URL: https://facebook.com/123456789_987654321
📊 Execution Log:
- Tool: Facebook Tool
- Action: create_text_post
- Status: Success
- Timestamp: 2025-01-09T10:30:45.123Z
- Duration: 1250ms
- Page ID: 123456789
Server Console Logs
[AI_AGENT_LOG][SUCCESS] [Facebook Tool:create_text_post] [2025-01-09T10:30:45.123Z] Text post created successfully
Data: {
"postId": "123456789_987654321",
"message": "Hello from AI Agent!",
"url": "https://facebook.com/123456789_987654321",
"duration": "1250ms"
}
🔄 Workflows & Examples
Example 1: Automated Social Media Posting
Schedule Trigger → HTTP Request (Get Content) → Facebook Page Actions (Create Post)
Example 2: Customer Support Automation
Facebook Page Trigger (New Comment) → Condition (Check Sentiment) → Facebook Page Actions (Reply)
Example 3: Content Moderation
Facebook Page Trigger (New Comment) → AI Analysis → Facebook Page Actions (Hide/Delete Comment)
Example 4: Multi-Platform Publishing
Trigger → Set Variables → Facebook Page Actions
→ Twitter
→ LinkedIn
Example 5: AI Agent Social Media Manager
AI Agent → Facebook Tool (create_text_post) → Success Response
→ Facebook Tool (get_posts) → Posts Retrieved
→ Facebook Tool (create_comment) → Comment Added
Example 6: Real-time Engagement Tracking
Facebook Page Trigger (New Post) → Facebook Page Actions (Get Post Insights) → Database Store
🔧 Troubleshooting
Common Issues
"Failed to load Pages: No access token found"
Solution:
- Reconnect your Facebook account in credentials
- Ensure your Facebook app is active
- Check app ID and secret are correct
"No Pages found"
Solution:
- Ensure you have admin/editor access to at least one Facebook Page
- Check your Facebook app has
pages_show_list
permission - Try reconnecting your Facebook account
"Image URL not accessible"
Solution:
- Ensure the image URL is publicly accessible
- Use HTTPS URLs when possible
- Check image format is supported (JPEG, PNG, GIF, WebP, BMP, TIFF)
- Maximum file size is 100MB
"Authentication failed"
Solution:
Check App ID and Secret:
- Verify you copied the correct App ID (not App Name)
- Ensure App Secret is copied completely (click "Show" first)
- No extra spaces or characters
Check OAuth Redirect URI:
- Must match exactly:
https://your-n8n-domain.com/rest/oauth2-credential/callback
- For localhost:
http://localhost:5678/rest/oauth2-credential/callback
- No trailing slashes or extra characters
- Must match exactly:
Check App Status:
- App must be in Development or Live mode
- If in Development: Only you can use it
- If Live: Requires App Review approval
Check Permissions:
- Ensure all required permissions are added
- Grant permissions during Facebook authorization
- Check if permissions were revoked in Facebook settings
"App ID or App Secret is invalid"
Solution:
Double-check credentials:
- Go to Facebook Developer Console → App Settings → Basic
- Copy App ID exactly (numbers only)
- Click "Show" for App Secret, then copy
- Paste in n8n Client ID and Client Secret fields
App Secret Reset:
- If secret is compromised, click "Reset App Secret"
- Copy the new secret to n8n
- Reconnect your account
"Redirect URI Mismatch"
Solution:
Check n8n URL:
- Your n8n URL:
https://your-domain.com
- Required redirect URI:
https://your-domain.com/rest/oauth2-credential/callback
- Your n8n URL:
Add to Facebook App:
- Facebook Login → Settings → Valid OAuth Redirect URIs
- Add the exact URL (case-sensitive)
- Save changes
"Rate limit exceeded"
Solution:
- Implement delays between requests
- Use Facebook's batch API when possible
- Monitor your app's rate limit usage
- Consider upgrading your Facebook app tier
Community Nodes Installation Issues
"Package not found" Error
Solution:
- Make sure you're using the exact package name:
@umairabubakkar/n8n-nodes-private-fb
- Check your internet connection
- Try refreshing the Community Nodes page
- Wait a few minutes after publishing (npm propagation delay)
"Installation failed" Error
Solution:
- Check n8n server logs for detailed error messages
- Ensure n8n has write permissions to node_modules
- Try restarting n8n and installing again
- For self-hosted: Check disk space and memory
Nodes not appearing after installation
Solution:
- Hard refresh your browser (Ctrl+F5 or Cmd+Shift+R)
- Restart n8n completely
- Clear browser cache and reload
- Check if package shows as "Installed" in Community Nodes
- Look for "Facebook" in the node search
Update to newer version
Solution:
- Go to Settings → Community Nodes
- Find
@umairabubakkar/n8n-nodes-private-fb
- Click Update button if available
- Restart n8n after update
Debug Mode
- Enable Enhanced Logging: Set to
true
in Facebook Tool configuration - Check Server Console: Look for
[FACEBOOK_TOOL]
and[AI_AGENT_LOG]
entries - Use Test Mode: Execute workflows in test mode first
- Monitor API Responses: Check Facebook Graph API Explorer for direct testing
Image Upload Issues
The package includes a 3-tier fallback system for image uploads:
- Direct URL Method - Fastest for public images
- Upload-First Method - Most reliable for protected images
- Resumable Upload API - Most robust for large files
If image uploads fail, check:
- Image URL accessibility
- File format support
- File size limits
- Network connectivity
📈 Keywords & SEO
🔍 Core n8n Facebook Keywords
n8n
n8n-node
n8n-community-node
facebook
facebook-api
social-media
automation
workflow
integration
oauth2
graph-api
page-integration
social-posting
triggers
webhooks
real-time
ai-agent
ai-tool
logging
langchain
🚀 Facebook Integration Keywords
n8n-facebook
n8n-facebook-integration
n8n-facebook-node
facebook-graph-api
facebook-automation
facebook-bot
social-media-automation
easy-integration
facebook-messenger
facebook-insights
facebook-posting
facebook-comments
facebook-pages
facebook-marketing
facebook-analytics
facebook-webhooks
facebook-oauth
facebook-integration
facebook-scheduler
📱 Facebook Features Keywords
facebook-content
facebook-engagement
facebook-management
facebook-tools
facebook-integration
facebook-workflow
facebook-triggers
facebook-events
facebook-media
facebook-photos
facebook-videos
facebook-links
facebook-api-v18
facebook-graph
facebook-sdk
🌐 Social Media Keywords
social-automation
social-posting
social-media-management
social-media-tools
social-media-scheduler
social-media-analytics
social-media-bot
social-media-integration
social-media-workflow
content-automation
content-publishing
content-management
content-scheduler
📊 Marketing & Business Keywords
marketing-automation
digital-marketing
social-marketing
automated-posting
automated-responses
automated-engagement
chatbot
messenger-bot
customer-support
community-management
brand-monitoring
social-listening
engagement-automation
lead-generation
crm-integration
business-automation
⚙️ Technical & Automation Keywords
workflow-automation
no-code
low-code
api-integration
webhook-integration
real-time-automation
event-driven
trigger-based
scheduled-automation
bulk-operations
batch-processing
multi-platform
cross-platform
omnichannel
unified-messaging
📈 Analytics & Data Keywords
social-crm
social-analytics
performance-tracking
metrics-automation
reporting-automation
dashboard-integration
data-sync
data-integration
api-wrapper
sdk-wrapper
🔐 Security & Enterprise Keywords
oauth-integration
secure-authentication
token-management
permission-management
role-based-access
enterprise-ready
scalable-automation
reliable-integration
production-ready
👨💻 Developer & Brand Keywords
umairabubakkar
aiwala
ai-wala
pakistan-developer
n8n-expert
automation-expert
facebook-specialist
🎯 Popular Search Phrases
- "n8n facebook node" - Main search term for n8n Facebook integration
- "facebook automation n8n" - Facebook workflow automation
- "n8n social media" - Social media automation with n8n
- "facebook api integration" - Facebook API made easy
- "automated facebook posting" - Scheduled content publishing
- "facebook bot n8n" - Chatbot and customer service
- "social media automation tool" - Complete social media management
- "facebook marketing automation" - Marketing workflow automation
- "n8n community nodes" - Community-built integrations
- "facebook graph api wrapper" - Simplified API access
- "social media scheduler" - Content calendar automation
- "facebook analytics automation" - Performance tracking
- "messenger bot integration" - Customer support automation
- "facebook webhook handler" - Real-time event processing
- "social media management platform" - Complete social media solution
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
📞 Support
- GitHub Issues: Report bugs and feature requests
- n8n Community: Join discussions
- Documentation: Check this README for comprehensive guides
- Facebook Developers: Official API documentation
🙏 Acknowledgments
- n8n team for the excellent automation platform
- Facebook Graph API team for comprehensive API documentation
- Community contributors and testers
- AI Agent early adopters who provided valuable feedback
Made with ❤️ for the n8n community
Transform your Facebook page management with powerful automation, AI integration, and real-time monitoring capabilities!