elAIguide
Free guide

How my Instagram DM assistant works.

One n8n workflow answers DMs and comments for a creator's page: keywords, real questions, and a human who can take over any time.
This is the system from my Reel "I built my own ManyChat". Here's exactly how it's built.

What it does

  • Someone comments a keyword under a post → they get the link in their DMs within seconds.
  • Someone asks a real question in the DMs → the AI answers, any time of day, in the page's own language.
  • The owner replies herself → the assistant steps back for that person for 12 hours.

What you need

  • An Instagram professional account (Business or Creator).
  • A Meta developer app with "Instagram API with Instagram Login" (messages + comments permissions). This is the official way: no password sharing, no shady bots.
  • An n8n server. Mine runs on my own server in Germany.
  • An AI model (for example Gemini or Claude) and a web search tool for the AI.

The workflow, step by step

1. Instagram sends every new DM and comment to n8n

A webhook in n8n receives each event from Meta in real time.

2. "Route": what is it?

A small code step reads the event and decides: a comment or a DM? A keyword? A message the bot sent itself? It skips anything it shouldn't answer.

3. Keyword rules (the ManyChat part)

A simple list in one settings node: keyword → reply text + link. A new campaign = one new line. No extra subscription.

4. The AI agent (the real questions)

Everything else goes to an AI agent with clear instructions:

  • answer in the page's own language, short and friendly,
  • search only official websites before answering facts,
  • never give prices or promises,
  • if unsure, say so and pass it to a human.

5. Long answers are split

Instagram messages have a length limit, so long replies are split into a few DMs and sent in order.

6. Human takeover

Every message the bot sends carries an invisible marker. When a message without that marker appears in the chat, the owner typed it → the bot pauses for that person for 12 hours. The owner can also type #botoff (never answer this person) or #boton (answer again).

Good to know

  • Meta rules: you can only reply to people who messaged or commented first. The assistant never cold-messages anyone.
  • The access token expires about every 60 days. Put a reminder in your calendar.
  • Costs: a small server plus the AI usage. With a "lite" AI model, a small page costs very little per month; costs grow with message volume.
  • Test with friends first, then go live.

Want one for your page?

I build this for creators and businesses: your keywords, your tone, your rules, set up and tested.