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.
- 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
- Developer: Umair Abubakkar - n8n automation expert
- Company: AI Wala - AI & Automation Solutions
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
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
npm install @umairabubakkar/n8n-nodes-private-fbAdd to your package.json or install via npm in your Docker container:
RUN npm install @umairabubakkar/n8n-nodes-private-fb- 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
- 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!
- 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
- 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
- Features
- Nodes Overview
- Installation & Setup
- Facebook App Configuration
- Node Configurations
- API Operations
- AI Agent Integration
- Workflows & Examples
- Troubleshooting
- Keywords & SEO
- 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
- 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
- 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
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
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
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
npm install @umairabubakkar/n8n-nodes-private-fb- Go to n8n Settings → Community Nodes
- Install:
@umairabubakkar/n8n-nodes-private-fb - Restart n8n
# If using Docker
docker restart n8n
# If using npm/yarn
npm restart
# or
yarn restart-
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"
-
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:
-
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
-
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)
-
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" ✅
- 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! 🎉
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 │
└─────────────────────────────────────────────────────────┘
-
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
{
"resource": "post",
"operation": "createTextPost",
"pageId": "your-page-id",
"message": "Hello from n8n! 🚀"
}{
"pageId": "your-page-id",
"triggerOn": "newPost",
"triggerMethod": "webhook",
"verifyToken": "your-verify-token"
}{
"pageId": "your-page-id",
"actionPreset": "community_manager",
"enableEnhancedLogging": true
}{
"resource": "post",
"operation": "createTextPost",
"message": "Your post content here"
}{
"resource": "post",
"operation": "createPhotoPost",
"inputType": "url",
"imageUrl": "https://example.com/image.jpg",
"caption": "Photo caption"
}{
"resource": "post",
"operation": "createVideoPost",
"videoInputType": "url",
"videoUrl": "https://example.com/video.mp4",
"videoDescription": "Video description"
}{
"resource": "post",
"operation": "createLinkPost",
"linkUrl": "https://example.com",
"linkMessage": "Check this out!"
}{
"resource": "post",
"operation": "createScheduledPost",
"message": "Scheduled content",
"scheduledPublishTime": "2024-12-31T12:00:00Z"
}{
"resource": "post",
"operation": "createTextPostWithBackground",
"backgroundPostMessage": "Stylish text",
"textFormatPresetId": "1777259169190672"
}{
"resource": "comment",
"operation": "getComments",
"commentPostId": "post-id",
"limit": 25
}{
"resource": "comment",
"operation": "createComment",
"commentPostId": "post-id",
"commentMessage": "Great post!"
}{
"resource": "comment",
"operation": "createCommentWithImage",
"commentPostId": "post-id",
"imageInputType": "url",
"imageUrl": "https://example.com/image.jpg",
"commentMessage": "Check this out!"
}{
"resource": "message",
"operation": "sendTextMessage",
"recipientId": "user-id",
"messageText": "Hello! How can I help you?"
}{
"resource": "message",
"operation": "sendImageMessage",
"recipientId": "user-id",
"imageUrl": "https://example.com/image.jpg"
}{
"resource": "insights",
"operation": "getPageInsights",
"metric": "page_impressions",
"period": "day"
}{
"resource": "insights",
"operation": "getPostInsights",
"postId": "post-id",
"metric": "post_impressions"
}{
"resource": "media",
"operation": "uploadPhoto",
"inputType": "url",
"imageUrl": "https://example.com/image.jpg",
"published": false
}{
"resource": "media",
"operation": "uploadVideo",
"videoInputType": "url",
"videoUrl": "https://example.com/video.mp4",
"videoDescription": "Uploaded video"
}{
"resource": "event",
"operation": "createEvent",
"eventName": "Community Meetup",
"eventStartTime": "2024-12-31T18:00:00Z",
"eventDescription": "Join us for a great meetup!"
}- Full access to all Facebook operations
- Best for: Development and testing
[
'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'
][
'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'
][
'get_posts',
'get_post',
'get_comments',
'get_page_insights',
'get_post_insights',
'get_page_info',
'get_events'
][
'get_comments',
'create_comment',
'create_comment_with_image',
'send_text_message',
'send_image_message',
'get_page_info',
'get_posts',
'get_post'
]✅ 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
[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"
}
Schedule Trigger → HTTP Request (Get Content) → Facebook Page Actions (Create Post)
Facebook Page Trigger (New Comment) → Condition (Check Sentiment) → Facebook Page Actions (Reply)
Facebook Page Trigger (New Comment) → AI Analysis → Facebook Page Actions (Hide/Delete Comment)
Trigger → Set Variables → Facebook Page Actions
→ Twitter
→ LinkedIn
AI Agent → Facebook Tool (create_text_post) → Success Response
→ Facebook Tool (get_posts) → Posts Retrieved
→ Facebook Tool (create_comment) → Comment Added
Facebook Page Trigger (New Post) → Facebook Page Actions (Get Post Insights) → Database Store
Solution:
- Reconnect your Facebook account in credentials
- Ensure your Facebook app is active
- Check app ID and secret are correct
Solution:
- Ensure you have admin/editor access to at least one Facebook Page
- Check your Facebook app has
pages_show_listpermission - Try reconnecting your Facebook account
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
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
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
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
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
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)
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
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
Solution:
- Go to Settings → Community Nodes
- Find
@umairabubakkar/n8n-nodes-private-fb - Click Update button if available
- Restart n8n after update
- Enable Enhanced Logging: Set to
truein 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
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
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
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-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-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-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
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
social-crm social-analytics performance-tracking metrics-automation reporting-automation dashboard-integration data-sync data-integration api-wrapper sdk-wrapper
oauth-integration secure-authentication token-management permission-management role-based-access enterprise-ready scalable-automation reliable-integration production-ready
umairabubakkar aiwala ai-wala pakistan-developer n8n-expert automation-expert facebook-specialist
- "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
This project is licensed under the MIT License - see the LICENSE file for details.
- 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
- GitHub Issues: Report bugs and feature requests
- n8n Community: Join discussions
- Documentation: Check this README for comprehensive guides
- Facebook Developers: Official API documentation
- 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!