The hardest part of auto-posting Instagram carousels from n8n is not the workflow. It is getting a Meta token that can publish, never expires, and lives safely in n8n. Here is the exact path that worked, and every error we hit on the way.
What we built
A Notion database holds each carousel: slide image links, caption and publish date. Every morning an n8n workflow picks the next due row and publishes it to Instagram, at most every other day.
- Notion stores the captions, dates and status for each post.
- Google Drive hosts the slide JPEGs in a folder shared as "anyone with the link can view", because Instagram downloads each image from a public URL.
- n8n runs on a schedule, locks the row, uploads each slide, builds the carousel, publishes it and writes the post link back to Notion.
- Meta Graph API (Instagram API with Facebook Login, v26.0) does the actual publishing.
Everything except step 4 was quick. Step 4 needs one thing: a Page access token with publishing permissions, stored as an n8n credential. The rest of this post is how to get it.
Before you start
Most of our errors traced back to one of these three not being true. Check them first.
- The Instagram account is a Business or Creator account (Instagram app: Settings → Account type and tools).
- It is connected to a Facebook Page, not just linked in Accounts Center. From Instagram: Edit profile → Page → Connect existing Page.
- You are logged into Facebook as an admin of that Page. If you manage several Facebook accounts, use the one that owns the Page.
Step 1: Create a Meta app with the right use cases
Create a fresh app rather than reusing an old one. An older app we tried was built around Facebook Login for consumers, and Meta would not let us add the Instagram use case to it.
- Go to
developers.facebook.com/apps/creationand enter an app name and contact email. - Under Content management, tick Manage messaging & content on Instagram and Manage everything on your Page.
- For business portfolio, choose I don't want to connect a business portfolio yet.
- Click Create app.
- Open Use cases → Manage messaging & content on Instagram → Customize → Permissions and features. Click Add next to
instagram_basic,instagram_content_publish,pages_show_listandpages_read_engagement. Each should then show Ready for testing.
You do not need App Review for this. Standard access is enough when you only post to accounts you manage yourself.
Step 2: Get a user token in Graph API Explorer
Open developers.facebook.com/tools/explorer and set it up exactly like this:
| Setting | Value |
|---|---|
| Host (dropdown in the query bar) | graph.facebook.com, not graph.instagram.com |
| Version | v26.0 |
| Meta App | the app from Step 1 |
| User or Page | User Token |
| Permissions | pages_show_list, instagram_basic, instagram_content_publish, pages_read_engagement (+ business_management if the Page sits in a business portfolio) |
Click Generate Access Token. Facebook opens a popup in its own window. Pick Opt in to current accounts only, then tick your Page, your Instagram account, and your business if asked. Click Continue, Save, Got it.
This token lasts about an hour. That is fine: we only use it for the next two steps.
Step 3: Find your Instagram account ID
Type this query by hand (pasting can add a hidden space before me, which breaks it) and click Submit:
me/accounts?fields=name,instagram_business_account{id,username}
The answer lists every Page you manage. Find the Page your Instagram is connected to:
{
"data": [
{
"name": "Your Page",
"instagram_business_account": {
"id": "1784XXXXXXXXXXXXX",
"username": "your_handle"
},
"id": "PAGE_ID"
}
]
}
The id inside instagram_business_account is your Instagram user ID. It usually starts with 1784. The outer id is the Page ID, which you do not need here. The Instagram ID is not a secret, so it can sit in a normal n8n Set node.
Step 4: Turn it into a Page token that does not expire
The one-hour user token would break the automation by tomorrow. A Page token taken from a long-lived user token has no fixed expiry.
- Copy the token from Graph API Explorer and paste it into the Access Token Debugger (
developers.facebook.com/tools/debug/accesstoken). Click Debug, then Extend Access Token. The new token lasts about 60 days. - Back in Graph API Explorer, paste the extended token into the Access Token box and run
me/accounts?fields=name,access_token. - Copy the
access_tokennext to your Page. That is the Page token. - Debug it once more. It should say Type: Page and Expires: Never.
The Page token keeps working until you change your Facebook password, remove the app, or lose admin access to the Page. If any of those happen, repeat Steps 2 to 4.
Step 5: Store it in n8n and switch the app to Live
The token goes into an n8n credential, never into a node parameter, a Code node or a chat window.
- In n8n, go to Credentials → Create → Bearer Auth, give it a clear name and paste the Page token.
- In each Instagram HTTP Request node, set Authentication to Generic Credential Type, Generic Auth Type to Bearer Auth, and pick that credential. Our workflow has six such nodes: publishing limit, slide containers, carousel container, container status, publish, and permalink.
- Put the Instagram account ID and API version (
v26.0) in a Config (Set) node so every request reads them from one place. - In the Meta app, open Publish and click Publish. While an app is in development mode, its posts may only be visible to people with roles on the app. In our case Meta reported all required settings complete, so no extra fields were needed. If yours asks for a privacy policy URL or data deletion URL, fill those in App settings → Basic first.
Switching to Live does not invalidate the token you already made.
Test without posting anything
Before the first real post, we built a tiny separate workflow that checks everything except the final publish call. Instagram only shows a post after media_publish, so stopping before it is safe. Unused containers expire on their own after 24 hours.
GET /me?fields=id,namewith the token. It should return your Page, which proves it is a Page token.GET /{ig-user-id}/content_publishing_limit?fields=config,quota_usage. A healthy answer looks likequota_usage: 0with aquota_totalof 100 posts per 24 hours.POST /{ig-user-id}/mediawithimage_urlset to one of your hosted slides andis_carousel_item=true. You get back a container ID.- Wait about 10 seconds, then
GET /{container-id}?fields=status_code,status.FINISHEDmeans Instagram could download and accept your image.
Step 4 is the real test of your image hosting. If it fails, the problem is the image URL, not the token.
Errors we hit and how we fixed them
In the order we met them:
| What we saw | Cause | Fix |
|---|---|---|
| Instagram popup: "Invalid Request: Invalid platform app" | Graph API Explorer was on graph.instagram.com (Instagram Login), which the app was not set up for |
Switch the host to graph.facebook.com and use User Token |
Object with ID ' me' does not exist |
A hidden space before me from pasting |
Clear the query box and type the path by hand |
me/accounts returns Pages but no instagram_business_account |
instagram_basic not granted, or Instagram not selected in the login popup |
Add the permission, regenerate the token and tick the Instagram account in the popup |
| Login popup: "You don't have any Instagram accounts" | The Instagram account was linked in Accounts Center but not connected to a Page as a professional account | Switch to Business/Creator, then connect it to the Page from Edit profile → Page |
| "Error validating access token: the session is invalid because the user logged out" | We switched Facebook accounts in the browser | Regenerate the token while logged in as the Page admin |
| "All available use cases have been added to this app" | The old app type could not take the Instagram use case | Create a new app (Step 1) |
| Slide container: 500, code 1, subcode 99, "An unknown error occurred" | A one-off glitch on Meta's side; the same image worked seconds later | More retries on the slide upload step (5 tries, 5 s apart) and 2 s between slides |
The ids query parameter is deprecated in v26.0+ |
Batch lookups with ?ids= no longer work |
Query each media ID separately |
| n8n will not accept the workflow as its own Error Workflow | n8n greys out the current workflow, and error workflows must be published | Move error handling into a small separate workflow and publish it |
One more design choice that saved us: images must be at a public, direct URL. We first hosted slides in a GitHub repo, then moved them to a Google Drive folder shared as "anyone with the link can view", using drive.usercontent.google.com/download?id=FILE_ID&export=view links. Instagram accepted them.
Security checklist
- Tokens and the app secret live only in the n8n credential, never in node parameters, Code nodes, screenshots or chat.
- Cover the Access Token box in Graph API Explorer screenshots. An app token is as sensitive as the app secret.
- If a token or app token ever leaks, reset the app secret in App settings → Basic and generate a new Page token.
- Grant the login popup current accounts only, and only the Page and Instagram account the automation needs.
- Keep the image folder viewable by link but not discoverable, and put nothing else in it.
- Test with the no-publish workflow above before letting the scheduled workflow post for real.