n8n

How to Automate Instagram Comment Engagement?

Turn Instagram comments into quick, human style replies powered by AI. This setup helps social media teams keep conversations going under posts without watching the feed all day. It is great for brands, creators, and agencies that want faster engagement.

New comment events arrive through a secure webhook. A response step confirms the Meta handshake by echoing the challenge token. The flow then maps key fields, fetches the post caption from Instagram Graph, and checks that the comment did not come from the account owner. A Set step organizes user id, username, message id, message text, and media id. A Filter node named its me prevents self replies. A request to the Instagram Graph API v22.0 returns the caption for extra context. The AI Agent uses OpenRouter to write a friendly reply that fits an AI and automation profile. An HTTP call posts the response back under the original post.

Setup needs an Instagram Graph access token, a verified webhook, and an OpenRouter API key. Expect shorter reply times, a steady brand tone, and the ability to handle a larger comment volume with the same team. Add this when you run launches, promotions, and posts where many people ask similar questions. In Meta App settings, use the same verify token as in n8n. Map fields to match your exact payload and adjust the prompt to your voice. Test with a real comment and fine tune phrasing as needed.

What are the key features?

  • Webhook verification that echoes the hub.challenge for Meta setup
  • New comment intake through an Instagram webhook endpoint
  • Structured field mapping with a Set node for ids and text
  • Owner check using a Filter node named its me to avoid self replies
  • Post caption lookup from Instagram Graph API v22.0 for context
  • AI reply creation with OpenRouter Chat Model and a guided prompt
  • Automatic posting of the reply via an HTTP request to Instagram
  • Simple credential control to swap models or tokens without code

What are the benefits?

  • Reduce manual replies from 2 hours per day to 10 minutes
  • Automate up to 90 percent of routine comment answers while staying on brand
  • Cut average response time to under 2 minutes even after hours
  • Handle 10 times more comments during campaigns without extra staff
  • Connect Instagram Graph API and OpenRouter in one place
  • Lower errors by skipping replies to your own account

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Instagram Webhooks, Instagram Graph API and OpenRouter. See the Tools Required section above for links to create accounts with these services.
  3. In Meta for Developers, create or use an app with Instagram Graph API. Connect the Instagram Business account and ensure permissions for instagram_basic and instagram_manage_comments.
  4. Open the Webhook node in n8n and copy the Production URL. In Meta App settings add this as the callback URL for Instagram Webhooks and set the same verify token you use in n8n. Use the verify tool to confirm the handshake.
  5. In the n8n credentials manager, create an HTTP Header Auth credential for Instagram Graph. Add Authorization as the header name and Bearer your_long_lived_token as the value. Name the credential clearly.
  6. Open the Get post data node and select your HTTP Header Auth credential. Keep the url field that calls v22.0 and returns id and caption.
  7. Open the Post comment node and select the same HTTP Header Auth credential. Confirm the request posts to the Instagram Graph comments endpoint for the related media id.
  8. For OpenRouter, create an API key in your OpenRouter account. In n8n create the OpenRouter credential, then select it in the OpenRouter Chat Model node. Keep or adjust the model to match your plan.
  9. Review the data Set node and ensure it maps entry id, from id, from username, message id, message text, and media id from your incoming payload structure.
  10. Open the its me Filter node and verify the condition compares the account id to the incoming user id so the flow skips self replies.
  11. Publish the workflow and send a real comment on a connected post. Check the n8n execution log, confirm the AI reply, and adjust the AI Agent prompt to fit your tone and policy.
  12. If verification fails, confirm the verify token matches on both sides. If posting fails, check token scope and expiry. If the AI step errors, confirm your OpenRouter key and model limits. If fields are empty, inspect the webhook payload and update mappings.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Instagram Graph API

Sign up

Process manually

Instagram Webhooks

Sign up

Free: $0 (no Meta fee; rate limits apply)

OpenRouter

Sign up

Free models: $0 via API, 20 requests/min; 50/day or 1000/day with ≥10 credits

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.