How to Automate Facebook & Instagram Posts with n8n in
Most businesses waste hours each week manually posting to social media - only to see inconsistent engagement. This complete n8n workflow shows you how to connect both platforms through Meta's API, generate long-term access tokens, and automate posting - including AI-generated images that keep your feed fresh.
Meta Developer Setup: Your Gateway to Automation
Before you can automate social media posts, you need proper API access through Meta's developer platform. Most tutorials skip critical steps that lead to broken workflows when tokens expire unexpectedly. The complete setup involves three key components:
First, create a new app in Meta for Developers (previously Facebook Developer). Choose "Business" as your app type - this gives you access to both Facebook and Instagram APIs. At 2:15 in the video, you'll see how to select the correct permissions including pages_manage_posts and instagram_content_publish.
Pro Tip: Connect your Facebook Page and Instagram account through Meta Business Suite before generating your access token. This ensures both platforms are available through a single credential.
Access Token Secrets Most Tutorials Miss
Standard Meta access tokens expire after just one hour - completely useless for automation. The critical step most guides omit is extending your token's lifespan to 60 days using the Token Debugger tool.
After generating your initial token in Graph API Explorer (shown at 5:45 in the video), immediately visit the Access Token Debugger. Click "Extend Access Token" to convert your short-lived token into a long-lived version. This simple but crucial step means your automation won't break daily.
Facebook Posting Workflow in n8n
With your credentials ready, the Facebook portion of the workflow is surprisingly simple. Add a Facebook Graph API node in n8n and configure it with:
- Your extended access token
- Page ID (found in Meta Business Suite)
- Edge type set to "feed"
Add a query parameter named "message" containing your post text. When executed, this will immediately publish to your connected Facebook Page. The video at 8:30 shows how to test this with a simple "Hello World" post.
Instagram's Special Requirements
Instagram automation has three non-negotiable requirements that differ from Facebook:
- Every post must include an image (no text-only posts)
- Images must meet specific size and format requirements
- Posts happen in two API calls - create container then publish
The workflow addresses these by first generating an AI image (covered next), then uploading it through Cloudinary to ensure proper formatting, before finally publishing to Instagram.
Automating AI Image Generation
Manually creating images defeats the purpose of automation. The workflow solves this by integrating OpenAI's image generation directly into the n8n flow:
Time Saver: Adding AI image generation means your Instagram feed stays fresh with unique visuals without any manual effort.
After your trigger node, add an OpenAI node configured for image generation. Simple prompts like "minimalist sky photo with clouds" produce professional-looking images. At 12:10 in the video, you'll see how to connect this to the rest of the workflow.
Why Cloudinary is Essential for Instagram
Instagram's API requires images to be hosted at a public URL - you can't upload binary files directly. Cloudinary solves this by:
- Providing reliable image hosting
- Automatically resizing to Instagram's preferred dimensions
- Generating the exact URL format Instagram's API requires
The video at 14:45 shows the complete Cloudinary setup process, including how to get your API key and configure the upload node in n8n.
Critical Error Handling for Reliability
Social media automation fails when you don't anticipate common issues. This workflow includes three key safeguards:
- Token expiration checks (attempt renewal when near expiry)
- Image validation (confirm proper format before posting)
- Error notifications (Slack or email alerts if posting fails)
At 16:30 in the video, you'll see how to add these reliability layers to ensure your automation runs smoothly for months.
Watch the Full Tutorial
See the complete workflow in action - including the critical moment at 6:45 where we extend the access token lifespan from 1 hour to 60 days. The video demonstrates each step with real accounts so you can follow along exactly.
Key Takeaways
Automating Facebook and Instagram posts with n8n eliminates hours of weekly busywork while ensuring consistent engagement. The complete solution requires careful setup but runs reliably for months with minimal maintenance.
In summary: 1) Create a Meta developer app, 2) Generate and extend your access token, 3) Connect both platforms in n8n, 4) Automate AI image generation, and 5) Add error handling for reliability. Done right, this workflow can save 5+ hours per week on social media management.
Frequently Asked Questions
Common questions about this topic
Standard Meta access tokens expire after 1 hour, but you can extend them to last 2 months using the token debugger tool.
The video at 6:45 shows exactly how to extend your token's lifespan for automation purposes. Without this step, your workflow would break daily.
- Initial token: 1 hour lifespan
- Extended token: 60 days lifespan
- Requires periodic renewal
No, Instagram's API requires an image for every post. The workflow demonstrates how to automatically generate AI images using OpenAI and upload them via Cloudinary before posting to Instagram.
This actually becomes an advantage - your feed stays visually consistent without manual design work.
- Instagram mandates images
- AI generation solves content creation
- Cloudinary handles formatting
No, you can use a single Meta developer account and access token for both platforms. The tutorial shows how to connect both accounts through Meta Business Suite at 3:20 in the video.
This unified approach simplifies maintenance - one token manages both services.
- Single Meta developer account
- One access token covers both
- Connected through Business Suite
Meta's Graph API allows approximately 200 posts per page per hour. For most businesses, scheduling 3-5 posts daily won't approach these limits.
The workflow includes error handling to manage rate limits gracefully if you do approach the thresholds.
- 200 posts/hour limit
- Error handling built-in
- Queue system for high volume
You need pages_show_list, pages_read_engagement, pages_manage_posts, instagram_basic, and instagram_content_publish permissions.
The video at 5:10 shows which boxes to check when generating your access token. Missing any of these will cause posting failures.
- 5 critical permissions
- Facebook + Instagram specific
- Must be requested upfront
Yes, you can add n8n's Schedule Trigger node to post at specific times. The workflow can be modified to pull content from a database or Google Sheet for fully automated posting schedules.
This transforms the basic workflow into a complete social media calendar automation system.
- Schedule Trigger enables timing
- Integrate with content calendars
- Time zone aware
While not strictly required, Cloudinary provides reliable image hosting with automatic resizing that meets Instagram's requirements.
You could substitute another image hosting service if preferred, but Cloudinary's API integration makes it particularly well-suited for this workflow.
- Not mandatory but recommended
- Handles image formatting automatically
- Free tier available
GrowwStacks builds custom social media automation workflows that connect Meta platforms with your content calendars, CRM, and AI tools.
We'll configure your n8n instance, handle API connections, and create approval workflows - typically deploying a complete solution in 3-5 business days with a free initial consultation.
- Custom workflow design
- API connection management
- Free 30-minute consultation
Stop Wasting Time on Manual Social Media Posting
Every hour spent manually posting is an hour not growing your business. Let GrowwStacks build your custom n8n automation that handles Facebook and Instagram posting - including AI-generated images - while you focus on strategy.