Back to Blog
n8nInstagramsocial mediaautomationintegration

n8n + Instagram Integration: Automate Posts, DMs & Analytics

n8nautomation TeamApril 11, 2026
TL;DR: n8n connects to Instagram through the Meta Graph API, letting you automate post scheduling, DM routing, comment moderation, engagement tracking, and analytics reporting. This guide covers five practical workflows you can build today using n8n's HTTP Request node and Instagram Business API.

Connecting n8n to Instagram opens up a range of automations that social media managers, agencies, and e-commerce teams can use to save hours every week. Instead of manually posting content, triaging DMs, or pulling engagement numbers into spreadsheets, you can build workflows that handle it all on autopilot. The Instagram Business API (part of the Meta Graph API) gives you programmatic access to publishing, messaging, comments, and insights — and n8n is the perfect tool to tie it all together.

How n8n Connects to Instagram

Instagram doesn't have a dedicated built-in node in n8n, but that's not a limitation. The HTTP Request node gives you full access to every endpoint in the Meta Graph API. You can also use n8n's OAuth2 credential type to handle authentication cleanly, so tokens refresh automatically without manual intervention.

The key endpoints you'll work with are:

  • POST /{ig-user-id}/media — create a media container for publishing
  • POST /{ig-user-id}/media_publish — publish the container
  • GET /{ig-user-id}/conversations — retrieve DM threads
  • GET /{ig-media-id}/comments — pull comments on a post
  • GET /{ig-user-id}/insights — fetch account-level analytics

All of these work through standard HTTP requests in n8n, meaning you have the same flexibility as a custom-coded integration but with a visual workflow builder.

Setting Up Instagram API Credentials in n8n

Before building any workflow, you need a Meta App with Instagram Graph API access. Here's the setup:

  1. Go to Meta for Developers and create a new app (select "Business" type).
  2. Add the Instagram Graph API product to your app.
  3. Connect your Instagram Business or Creator account through a linked Facebook Page.
  4. Generate a long-lived access token (valid for 60 days) or configure OAuth2 for automatic refresh.
  5. In n8n, create a new Header Auth credential or an OAuth2 API credential with your app's client ID, client secret, and token URL (https://graph.facebook.com/oauth/access_token).

Once your credentials are saved, every HTTP Request node in your workflows can reference them — no need to paste tokens manually.

Tip: Use n8n's built-in credential sharing to give team members access to the Instagram API without exposing the raw token. If you're running your instance on n8nautomation.cloud, your credentials are encrypted at rest and backed up automatically.

Schedule Instagram Posts Automatically

This workflow pulls content from a Google Sheet (or Notion database, Airtable — whatever you use as a content calendar) and publishes it to Instagram on a schedule.

Workflow structure:

  1. Schedule Trigger node — fires at your desired posting time (e.g., every day at 9 AM).
  2. Google Sheets node — reads the next row where the "Status" column is "Ready".
  3. HTTP Request node (Create Container) — sends a POST to /{ig-user-id}/media with the image_url and caption from your spreadsheet.
  4. HTTP Request node (Publish) — takes the creation_id from the previous step and POSTs to /{ig-user-id}/media_publish.
  5. Google Sheets node (Update) — marks the row status as "Published" with a timestamp.

For carousel posts, the flow adds an extra loop: create a container for each image first, then create a carousel container referencing all child IDs, then publish. n8n's Loop Over Items node handles this cleanly.

For Reels, use the same /media endpoint but pass media_type=REELS and a video_url instead. The API processes the video asynchronously, so add a Wait node (30-60 seconds) before the publish step, or use a polling loop to check the container status.

Route Instagram DMs to Your CRM

If your business gets customer inquiries through Instagram DMs, manually checking them is a bottleneck. This workflow routes new messages into your CRM or helpdesk automatically.

Workflow structure:

  1. Webhook node — receives real-time updates from Instagram's Webhooks API (subscribe to the messages field on your Instagram account).
  2. IF node — filters out echo messages (messages your account sent) by checking message.is_echo.
  3. HTTP Request node — fetches the sender's Instagram profile info from /{user-id}?fields=name,username,profile_picture_url.
  4. Switch node — routes based on message content. Keywords like "order", "shipping", or "return" go to your e-commerce support queue. Everything else goes to general inquiries.
  5. HubSpot/Pipedrive/Salesforce node — creates or updates a contact with the Instagram username, then logs the message as an activity or note.
  6. Slack node — optionally notifies your team in a dedicated channel so someone can respond quickly.

This setup means no DM falls through the cracks, and your CRM has a complete record of Instagram conversations alongside email and phone interactions.

Automate Instagram Comment Moderation with AI

High-volume accounts can't manually review every comment. This workflow uses n8n's AI capabilities to classify and moderate comments automatically.

Workflow structure:

  1. Webhook node — receives comment notifications via Instagram Webhooks (subscribe to the comments field).
  2. HTTP Request node — fetches the full comment text and author info from /{comment-id}?fields=text,username,timestamp.
  3. OpenAI node (or any LLM) — sends the comment text to an AI model with a prompt like: "Classify this Instagram comment as: positive, question, spam, or toxic. Respond with only the category."
  4. Switch node — routes based on the AI classification:
    • Spam/Toxic → HTTP Request node to DELETE /{comment-id} (hides the comment) and logs it to a Google Sheet for review.
    • Question → Slack notification to your social team with the comment text and a direct link to respond.
    • Positive → HTTP Request node to POST /{comment-id}/replies with a thank-you response (optional, use sparingly).

The AI classification step takes milliseconds and handles context far better than simple keyword matching. You can fine-tune the prompt to match your brand's moderation policy.

Note: Auto-deleting comments carries risk. Start by logging flagged comments to a spreadsheet for manual review. Once you trust the AI classifications (check accuracy over a few hundred comments), you can enable auto-hide for high-confidence spam and toxic results.

Build an Engagement Analytics Dashboard with n8n

Instead of logging into Instagram Insights every morning, build a workflow that pulls your metrics and pushes them wherever you need them.

Workflow structure:

  1. Schedule Trigger node — fires daily at 7 AM.
  2. HTTP Request node (Account Insights) — GET /{ig-user-id}/insights with metrics like impressions, reach, follower_count, profile_views, and a period of day.
  3. HTTP Request node (Recent Media) — GET /{ig-user-id}/media?fields=id,caption,like_count,comments_count,timestamp,permalink to pull per-post performance.
  4. Google Sheets node — appends a new row with the date and all metrics. Over time, this builds a historical dataset you can chart or analyze.
  5. Slack/Email node — sends a formatted daily summary: "Yesterday: 12,450 impressions, 340 profile views, +28 followers. Top post: [link] with 892 likes."

For agencies managing multiple client accounts, wrap this in a loop that iterates over a list of Instagram account IDs and tokens stored in a database or spreadsheet. Each client gets their own row or their own sheet tab.

Running this on n8nautomation.cloud means your scheduled triggers fire reliably — no worrying about your server going down overnight and missing the morning report.

Auto-Reply to Story Mentions

When someone mentions your brand in their Instagram Story, it's a high-intent engagement signal. This workflow sends an automatic DM to thank them — a tactic used by D2C brands to boost loyalty and encourage user-generated content.

Workflow structure:

  1. Webhook node — listens for story_insights or mentions webhook events from Instagram.
  2. IF node — checks that the mention is from a story (not a comment or caption mention).
  3. HTTP Request node — fetches the mentioning user's profile to get their username and follower count.
  4. Switch node — optionally segments by follower count. Users with 10k+ followers could get a different response (e.g., an invitation to your ambassador program).
  5. HTTP Request node (Send DM) — POSTs to /{ig-user-id}/messages with a personalized thank-you message: "Hey @username, thanks for sharing! We love seeing our products in the wild 🙌"
  6. Google Sheets node — logs every mention with the username, follower count, and timestamp for your marketing team to review.

Tip: Instagram rate-limits the Messaging API to around 250 messages per user per 24 hours for standard access. If you're a high-volume account, apply for Advanced Access through Meta's App Review to increase your limits.

All five of these workflows run as background processes on your n8n instance. There's no browser extension to break, no third-party scheduling tool to pay for, and no manual exports. Your automations live in one place, version-controlled through n8n's built-in workflow export, and running 24/7 on a dedicated instance at n8nautomation.cloud.

The Instagram Graph API is well-documented and stable, and n8n's HTTP Request node gives you access to every endpoint without waiting for a dedicated node to be built. If you can call an API, you can automate it in n8n — and Instagram is no exception.

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.