How to Post to Instagram with n8n in 2025

How to Post to Instagram with n8n in 2025

Mohamed Karms
Mohamed Karms
9 min read
58 views
Share:

Learn how to set up Instagram’s updated API and automate posts through n8n in 2025 using the new Meta app process, long-lived tokens, and the latest Instagram publishing workflow...

How to Post to Instagram with n8n in 2025 (Full Guide)

Launching an Instagram campaign in 2025 can be frustrating when "token expired" errors halt your automation. After significant API changes in late 2024, older n8n tutorials are no longer functional. This guide shows how to generate credentials, extend tokens, and post images in n8n.


1. Introduction

Set up your Instagram account as a Professional (Business or Creator) account, as required by the API changes for generating access tokens. If not already set up, Instagram will prompt you to set it up during the initial setup.

Instagram’s December 2024 API update introduced stricter authentication, new token workflows, and deprecated older endpoints, resulting in errors and expired token issues for existing n8n automations.

This guide details how to post to Instagram with n8n in 5 minutes: create a Meta App, add permissions, connect your Instagram account, generate and extend an access token, configure n8n, and successfully post images using the new workflow.

  • Add the proper permissions.

  • Connect your Instagram account.

  • Generate a valid access token.

  • Extend that access token to a long-lived status.

  • onfigure n8n credentials. Successfully post images using the new Instagram workflow.

Follow each step carefully, as missing one step often leads to invalid tokens or permission errors. To help you navigate smoothly, here are the top three critical pitfalls that could disrupt your workflow:

- If you skip creating a new Meta App, your API credentials will not be recognized.

- Failing to extend the access token will result in expired tokens within hours, breaking your automation.

- Missing permissions during setup can lead to authentication failures when trying to post images.


2. Create a Meta App

Meta owns Instagram, so all API credentials must be created through the Meta Developer dashboard.

Visit developers.facebook.com and sign in.

  1. Under My Apps, select Create App.

  2. Select 'Other' as the app category (avoid using old templates).

  3. When prompted, select "Business" as the app category.

  4. Name your app without using Instagram, Facebook, or Meta .

  5. ’.

  6. Click Create App to generate your Meta app.

Your basic Meta app is now ready. To confirm the setup, look for a green dot on your dashboard, which indicates that your app is active and properly configured.


3. Add the Instagram Product to the App

  1. Inside the App Dashboard, scroll to Instagram.

  2. Select Set Up next to Instagram.

  3. This enables all Instagram-related API tools and configuration pages inside your app.


4. Assign Instagram Tester Role

Your Instagram account must be added as a “Tester” to gain permissions.

Go to App Roles in the Meta dashboard.

  1. Select Add People and choose Instagram Tester.

  2. Find and enter your Instagram username.

  3. Add the account

This sends an invite to that Instagram account.

Accept the Tester Invite:

  1. Log in to Instagram (web browser).

  2. Go to instagram.com/accounts/manage_access and open Tester Invites.

  3. Accept the invite.

Once accepted, your Instagram account becomes authorized to generate tokens.


5. Confirm the Account is Linked

Return to the App Dashboard, open Instagram, and select 'Generate Access Token'.

Your Instagram account should be

ear here.
If not listed, select Add Account and log in again.

Important:
Your Instagram account must be a Professional (Business/Creator) account.
If it isn’t, Instagram will automatically prompt you to convert it.


6. Generate Your Access Token

There are two methods to generate your access token.

Method 1: Consider using this method if you are looking for a quick setup and are willing to handle potential issues manually. However, be aware that it may lead to authentication failures. Click "Generate Access Token" in the Instagram dashboard, log in, approve the permissions, and copy the token. If it works smoothly, great.

Method 2: Opt for this method if you prefer a more consistent and reliable approach, particularly if you anticipate needing robust long-term access. This involves using Meta's Graph API Explorer, which handles permissions more effectively.


Method 1 (Simple, but unreliable)

  1. Click Generate Access Token in the Instagram dashboard.

  2. Log in → Approve permissions.

  3. Copy the token.

If this works for you, great — but many users get authentication failures in n8n.


Method 2 (Advanced, reliable)

This method uses Meta’s Graph API Explorer, which handles permissions more consistently. To enhance security, consider storing your access token securely, such as by using environment variables. This practice helps safeguard credentials against unauthorized access, aligning with the principles of API governance. Ensure your development environment is configured to protect these variables effectively.

Steps:

  1. Go to Tools → Graph API Explorer from the Meta dashboard.

  2. Select the app you created.

  3. Under Permissions, add all Instagram-related permissions.

  4. Click Generate Access Token.

  5. Approve permissions using your Facebook profile (the token will still work for Instagram).

  6. Copy the token.

This initial access token expires after 1 hour. To ensure continuous automation in n8n, you must extend it into a long-lived token that is valid for about 60 days. Without this extension, your token will expire quickly and your automation will fail.


7. Extend the Token (Very Important)

Short-lived tokens expire after 1 hour, making them unsuitable for continuous n8n automation. A long-lived token ensures ongoing Instagram integration, uninterrupted promotional posts, and stable campaign engagement. If expired, you risk missing marketing opportunities and impacting campaign timing.

Steps:

  1. Go to Tools → Access Token Debugger.

  2. Paste your token.

  3. Click Debug.

  4. Scroll down and click Extend Access Token.

When you click Extend Access Token, a new long-lived token will be generated. This token typically lasts about 60 days, helping to maintain active automation. Always use this token for your Instagram workflows in n8n.

Copy the extended token — this is the one you’ll use in n8n.


8. Add the Token to n8n

Inside n8n:

  1. Go to Credentials.

  2. Create new → Search for Facebook Graph API.
    (Meta owns both Facebook & Instagram, so this is the correct credential.)

  3. Paste your extended token. Before saving, it's a good idea to run a simple "me" endpoint call to verify your token. This quick self-check can prevent silent failures later. Save.

  4. Test the credential — you should see a green success message.

If it fails, double-check that you did not accidentally include the word “debug” in the token (a common mistake).


Instagram requires a two-step process, much like drafting and then publishing a piece of content. These steps are crucial for ensuring that your post is structured correctly before it goes live on your feed.

Instagram requires a two-step process:

Step A — Create an Instagram Media Container

This prepares the image and caption.

Step B — Publish the Container

This makes the post go live on your Instagram feed.


Your n8n Workflow Structure

Manual Trigger  

      ↓  

Set Node (image URL + caption + IG Account ID)  

      ↓  

Facebook Graph API (Create Media Container)  

      ↓  

Facebook Graph API (Publish Media)

The N8N JSON for Free :

{
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [-380, -40],
      "id": "5275b596-a7ff-4598-93c8-1cb6e755f0a1",
      "name": "When clicking 'Test workflow'"
    },
    {
      "parameters": {
        "httpRequestMethod": "POST",
        "graphApiVersion": "v22.0",
        "node": "={{ $('Set IG post').item.json.Node }}",
        "edge": "media",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "image_url",
                "value": "={{ $json['Image Url'] }}"
              },
              {
                "name": "caption",
                "value": "={{ $json.Caption }}"
              }
            ]
          }
        }
      }
    },
    {
      "id": "542c6fce-d8eb-446d-8ef9-9cb47b4ad172",
      "name": "Create IG container",
      "type": "n8n-nodes-base.facebookGraphApi",
      "typeVersion": 1,
      "position": [0, -40],
      "credentials": {
        "facebookGraphApi": {
          "id": "H3OtOzWlkqxI7fBR",
          "name": "Biz_home (IG) Facebook Graph account"
        }
      }
    },
    {
      "parameters": {
        "httpRequestMethod": "POST",
        "graphApiVersion": "v22.0",
        "node": "={{ $('Set IG post').item.json.Node }}",
        "edge": "media_publish",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "creation_id",
                "value": "={{ $('Create IG container').item.json['id'] }}"
              },
              {
                "name": "Image_url",
                "value": "={{ $('Set IG post').item.json['Image Url'] }}"
              },
              {
                "name": "caption",
                "value": "={{ $('Set IG post').item.json.Caption }}"
              }
            ]
          }
        }
      }
    },
    {
      "id": "b381e57d-25a3-4fa5-8a23-6cbea9ddcabc",
      "name": "Post to IG",
      "type": "n8n-nodes-base.facebookGraphApi",
      "typeVersion": 1,
      "position": [200, -40],
      "credentials": {
        "facebookGraphApi": {
          "id": "H3OtOzWlkqxI7fBR",
          "name": "Biz.bemo (IG) Facebook Graph account"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "f291fa0f-3cea-46bb-af55-4dcfe4211023",
              "name": "Image Url",
              "value": "https://letsautomateit.biz/wp-content/uploads/2024/05/Robot-with-heart-853x1024.png",
              "type": "string"
            },
            {
              "id": "1360ea27-a311-469c-ae18-e8be7cded127",
              "name": "Caption",
              "value": "Posted by IG n8n Automation",
              "type": "string"
            },
            {
              "id": "80dc7838-21da-48d9-bd18-2cead756e706",
              "name": "Node",
              "value": "<insert your IG account ID>",
              "type": "string"
            }
          ]
        }
      },
      "options": {}
    },
    {
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [-200, -40],
      "id": "b60636b6-35b9-4a7a-abc9-9aa06936d394",
      "name": "Set IG post"
    }
  ],
  "connections": {
    "When clicking 'Test workflow'": {
      "main": [
        [
          {
            "node": "Set IG post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create IG container": {
      "main": [
        [
          {
            "node": "Post to IG",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set IG post": {
      "main": [
        [
          {
            "node": "Create IG container",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "meta": {
    "instanceId": "38d37c49298b42c645e6a7693766d7c3522b24e54454834f955422b5d7af611c"
  }
}

10. Required Values in The Set Node

Your Set node must include:

  • image_url – direct link to the image

  • caption – text to include under The post

  • ig_account_id – your Instagram account ID

You can find the Instagram Account ID in the App Dashboard under Generate Access Token.


11. Step A: Create Media Container Node

Configuration:

  • Resource: Custom

  • Method: POST

  • Edge: /media

  • Query Parameters:

  • image_url → your Set node field

  • caption → your Set node field

When you test this node, it should return a container ID.


12. Step B: Publish the Container

Configuration:

  • Resource: Custom

  • Method: POST

  • Edge: /media_publish

  • Query Parameter:

  • creation_id → container ID from previous step

Test the node — you should see a success message.


13. Confirm the Post on Instagram

Check your Instagram profile.
Your image, along with your caption, should appear instantly.


Conclusion

With Meta’s updated authentication process, posting to Instagram from n8n now requires additional steps; however, once set up correctly, it works reliably. The key points are: Create a proper Meta App. Add correct Instagram permissions. Accept the tester's invite. Generate a token using Graph Explorer. Extend the token life. Use Facebook Graph API credentials in n8n. Follow the two-step posting process (container → publish).

Looking ahead, it's crucial to stay updated with any API changes that Meta might introduce. Watch for announcements on the Meta Developer blog regarding new authentication protocols or feature updates that could affect your automations. Regularly check your token status and keep your n8n workflows up to date to ensure seamless Instagram integration as changes occur in 2025 and beyond.

you can See Full Tutorial from : Here

Comments

0 comments

Please sign in to join the conversation

No comments yet

Be the first to share your thoughts!