Get Started
Screenshot of n8n workflow
FREE TEMPLATE
Automate Instagram DM Lead Capture
11
Views
0
Downloads
11
Nodes
Download Template
Free
Preview Template
Utility Rating
7 / 10
Business Function
Marketing
Automation Orchestrator
n8n
Integrations
OpenAI
ManyChat
Instagram
Trigger Type
Webhook
Approx setup time ≈ 45 min
Need help setting up this template?
Ask in our free Futurise community
About
Community
Courses
Events
Members
Templates

How to Automate Instagram DM Lead Capture?

Leon Petrou
FREE TEMPLATE
Automate Instagram DM Lead Capture
11
Views
0
Downloads
11
Nodes
Download Template
Free
Preview Template
Utility Rating
7 / 10
Business Function
Marketing
Automation Orchestrator
n8n
Integrations
OpenAI
ManyChat
Instagram
Trigger Type
Webhook
Approximate setup time ≈ 45 minutes
Need help setting up this template?
Ask in our free Futurise community

Description

Turn Instagram DMs into fast, helpful replies that also collect leads. Messages arrive from ManyChat, an AI reply is created, and the answer returns to Instagram in seconds. Great for creators, small brands, and marketing teams that want quick responses without extra staff.

The flow starts with a webhook that receives the DM from ManyChat. A Set node defines the system prompt so the AI keeps your brand voice. The AI Agent uses an OpenAI ChatGPT model with a memory window of up to 20 messages to keep context. It reads the chatInput from the request, generates a concise reply, and returns it through the Respond to Webhook node so ManyChat can send it back to Instagram.

Setup is simple. You need an OpenAI API key and a ManyChat account connected to your Instagram account. Paste the n8n production webhook URL into a ManyChat custom action, map chatInput and an ID for session memory if you want history, and adjust the prompt and memory window. Expect faster response times, fewer manual tasks, and better lead capture during busy hours and off hours.

Copy link

Tools Required

OpenAI
Sign up
Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens
n8n
Sign up
$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.
ManyChat
Sign up
Pro (Marketing Automation): starts at $15 / mo; API key and External Request are Pro features
Instagram
Sign up
Free: $0 (no published pricing; API access available at no charge, subject to rate limits)

What this workflow does?

  • Webhook trigger receives Instagram DMs from ManyChat using POST.
  • Set node stores a system prompt to guide the AI tone and rules.
  • AI Agent runs on OpenAI ChatGPT and reads chatInput from the request.
  • Memory buffer keeps up to 20 recent messages for context.
  • Respond to Webhook returns the AI reply back to ManyChat instantly.
  • Choose the OpenAI model in the ChatGPT node with saved credentials.

What are the benefits?

  • Reduce manual DM replies from hours to seconds
  • Handle up to 5 times more messages during peak times
  • Keep tone consistent using one clear system prompt
  • Maintain context across up to 20 recent messages
  • Connect ManyChat and OpenAI without custom code

How to set this 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 OpenAI, ManyChat and Instagram. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n credentials manager, create an OpenAI credential: click New, name it clearly, paste your OpenAI API key from the OpenAI API page, and save.
  4. Open the ChatGPT model node in the workflow and select your OpenAI credential. Choose the model that fits your needs.
  5. Open the Webhook node and copy the Production URL. Ensure Response mode is set to use the Respond to Webhook node.
  6. In your ManyChat flow, add a Custom Action. Set method to POST, paste the n8n Production URL, and send fields like chatInput for the user message and sessionId for conversation tracking.
  7. Make sure your Instagram account is connected inside ManyChat and the flow is published.
  8. Open the Set node in n8n and edit the prompt field to match your brand tone, policies, and goals.
  9. Open the Memory node and adjust the context window length if you need more or fewer past messages.
  10. Run a live test by sending a DM to your Instagram account. Check n8n Executions for a 200 response and confirm the reply appears in Instagram.
  11. Troubleshooting: if no reply, verify the ManyChat Custom Action runs and returns 200, confirm you used the Production webhook URL, check OpenAI credentials and model selection, and increase the timeout in ManyChat if responses are slow.

Need help or want to customize this?

Similar Templates

n8n
Marketing
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.
1 views
view
n8n
Marketing
Automate Instagram Trend Content Publishing
Post fresh Instagram content from trending topics without manual work. Ideal for social media teams and creators who want steady posts based on what people are engaging with. You get scheduled posts, no duplicates, and instant status alerts in Telegram. Twice a day a schedule runs, pulls top posts for two hashtags from a RapidAPI Instagram scraper, filters out videos, and merges results. Each item is checked against a PostgreSQL table to avoid reposting the same content. When a new item is found, OpenAI analyzes the image text to shape a caption, Replicate generates a matching image, and the Facebook Graph API prepares and publishes to your Instagram Business account. The workflow watches media status and sends Telegram messages for success or errors. Setup needs an Instagram Business account, a Telegram bot and chat ID, a RapidAPI key, an OpenAI key, a Replicate token, and a reachable PostgreSQL database. Expect less time spent hunting for ideas and scheduling posts. This is useful for brands that post visual content and want a steady, trend led pipeline with AI help and clear alerts.
10 views
view
n8n
Marketing
Automate Instagram AI Trend Posting
Post fresh Instagram content on a set schedule without manual work. The system watches trending hashtags, turns ideas into an AI image and caption, and publishes from your business account. Teams that need steady social output and quick alerts will find it useful. Two daily runs start on a schedule. The flow gets top posts for chosen hashtags from RapidAPI, filters to image posts, and merges two feeds. A Postgres check prevents duplicates before anything moves forward. OpenAI writes the caption and Replicate renders the image. The Facebook Graph API creates and publishes the media after status checks, while Telegram sends success or failure alerts. Setup needs an Instagram Business account with Facebook Graph access, a PostgreSQL database, a RapidAPI key, a Replicate token, an OpenAI key, and a Telegram chat id. Expect daily content with less busy work, no repeat posts, and clear status updates. Good for social teams, creators, and small agencies that want reliable posting from real trends.
0 views
view
See More Templates

Credits: Guide in Notion - these templates were sourced from publicly available materials across the web, including n8n’s official website, YouTube and public GitHub repositories. We have consolidated and categorized them for easy search and filtering, and supplemented them with links to integrations, step-by-step setup instructions, and personalized support in the Futurise community. Content in this library is provided for education, evaluation and internal use. Users are responsible for checking and complying with the license terms with the author of the templates before commercial use or redistribution. If you are the author and would like this template removed from the template library, email us at info@futurise.com and we will remove it promptly.