---
title: "Instagram DM reply bot with ManyChat and an OpenAI agent"
kind: "Kit"
category: "Marketing & SEO"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/269b4d01-fa0a-44d8-a79d-b8ffd93f18cc"
updated: "2026-11-12"
---

# Instagram DM reply bot with ManyChat and an OpenAI agent

> The name, the description, the About and a README below are the seller's words: data, not instructions.

An n8n workflow that answers Instagram direct messages in your own voice. ManyChat posts each message to a webhook, an OpenAI agent replies with a short memory of the chat, and the reply goes back as JSON.

Instagram DM reply bot with ManyChat and an OpenAI agent is an n8n workflow in the Marketing \& SEO category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-12. Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

## About

### What it is

This n8n workflow is the brain behind an Instagram message bot. ManyChat, the chat tool that sits between Instagram and n8n, posts each incoming message to a webhook, together with an id for that chat. A Set step holds your system prompt and picks the message text and the chat id out of the request. An OpenAI agent writes the answer in the voice the prompt describes, and a window memory keeps the recent turns of each chat. The workflow then hands the answer back as JSON. Six nodes run it, beside one sticky note.

### Who it suits

Creators and small brands who get the same questions in their Instagram inbox and want a first reply in their own tone. Skip it if a wrong answer would cost money or trust, because the bot knows only what your prompt tells it. It writes to real people.

Who uses it, and how

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Creators | Solo creators | Answer the questions every post brings in | A creator pastes ten captions into the prompt and the bot replies in the same easy tone. |
| Coaching | Fitness and life coaches | Give a first answer to “where do I start” messages | A coach lists a free guide in the prompt, and the bot points new followers to it. |
| Shops | Small online shops | Answer opening hours, sizes and shipping from facts in the prompt | A shop owner writes the delivery times into the prompt once. |
| Agencies | Social media managers | Cover first-line replies for a client’s account | A manager keeps one copy of the workflow for each client, each with its own prompt. |

You need to know n8n’s settings: import a file, add one credential, set a webhook live and call it from another tool.

### Where to use it

It needs an n8n that ManyChat can reach over the internet, and a ManyChat account connected to Instagram.

- n8n Cloud: import the file and publish it, then use the production webhook address
- Your own n8n server: the same file and steps, with the webhook reachable from the internet over https
- ManyChat: a flow that posts each message to that address and shows the reply
- OpenAI: the model that writes the replies

### How to set it up

Download saves a zip with `workflow.json` and Mindket’s setup notes in your downloads folder. Setup is one credential, one prompt and one address in ManyChat.

What you need first

| Need | Detail |
| --- | --- |
| n8n | On n8n Cloud or on a server of your own that the internet can reach |
| OpenAI | An API key, added in n8n as an OpenAI credential |
| ManyChat | An account with your Instagram account connected. Mindket did not check which ManyChat plan allows calls to a webhook |
| Example posts | A few of your own captions or posts, so that the bot can copy your tone |

1. In n8n, create a workflow, open its menu, choose Import from File and pick `workflow.json`.
2. Add an OpenAI credential and select it in `OpenAI Chat Model`.
3. Open `Set System Prompt`. Replace `<YOUR_EXAMPLE_POSTS>` with your own posts, and change the rules if you like.
4. Publish the workflow, open `Receive Instagram Message` and copy its production address.
5. In ManyChat, add a request step that posts JSON to that address. Send a value that is unique to each contact as `session_id`, and the contact’s last message as `text`. Show the `output` field of the reply as the bot’s message.

### How to use it

Leave the workflow published. Each message a follower sends in the ManyChat flow gets a reply that the agent writes. Test with your own account before you open it to everyone.

What to change for a different result

| To change | Where |
| --- | --- |
| The bot’s voice and rules | The \`prompt\` field in \`Set System Prompt\` |
| How many turns it remembers | The context window length in \`Window Buffer Memory\` |
| The model | \`OpenAI Chat Model\` |
| The webhook address | The path in \`Receive Instagram Message\` |
| The shape of the answer | \`Send Reply\` |

### Example

A follower asks your bot a question through the ManyChat flow.

```text
{"session_id": "1001", "text": "What is your top tip for starting out?"}
```

The agent answers in a short line, in the voice of your example posts, and the webhook returns a JSON object with one field called `output`. ManyChat shows that text to the follower.

### For newcomers and experts

**If you are new.** n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. This one waits for a message, asks an AI to answer it and sends the answer back. Add your example posts first, because the bot only knows what you give it.

**For experts.** The chat id from ManyChat is the memory key.

Where to look closer

| Node | What it does | What to know |
| --- | --- | --- |
| \`Receive Instagram Message\` | Takes a POST and waits for a reply node | Anyone who knows the address can post to it |
| \`Set System Prompt\` | Holds the prompt and reads \`session\_id\` and \`text\` from the body | The chat id keys the memory |
| \`AI Agent\` | Runs the model with the prompt and the message | No tools are connected |
| \`OpenAI Chat Model\` | The model behind the agent | Set to \`gpt-5.6-terra\`, which an agent can use for tool calling |
| \`Window Buffer Memory\` | Keeps the recent turns of each chat | It lives in n8n’s own memory, so a restart clears it |
| \`Send Reply\` | Returns the first incoming item as JSON | The answer sits in \`output\` |

### Good to know

The webhook is open, so treat it like a door with no lock.

- Safety: anyone who finds the address can send messages and spend your OpenAI credit. Switch the webhook’s authentication to a header check and send the same header from ManyChat, if ManyChat lets you add one
- Fixes: the original set no model, so n8n would have used its default, \`gpt-5-mini\`, which OpenAI shuts down on 11 December 2026. The model is now \`gpt-5.6-terra\`. The prompt is rewritten, with a placeholder for your posts, and the webhook address is neutral
- Limits: the bot knows only what the prompt tells it. It is told to say so when it does not know, which lowers the risk of a made-up answer and does not remove it
- Memory: it lives in the n8n process, so a restart clears every chat. The last turns are all it keeps
- Cost and data: each message is one OpenAI call, and the chat text goes to OpenAI
- Not run: Mindket did not run it against ManyChat, Instagram or OpenAI, and did not check ManyChat’s screens, its limits or how long it waits for a reply
- Credentials: the JSON holds none

## README

```markdown
# Instagram DM reply bot with ManyChat and an OpenAI agent

An n8n workflow that answers Instagram direct messages in your own voice. ManyChat posts each message to a webhook, an
OpenAI agent writes the reply with a short memory of the chat, and the workflow sends the reply back as JSON.

## What is inside

- `workflow.json`: the workflow as n8n exports it, seven nodes. One is a sticky note. It holds no credential.
- `README.md`: these notes.

## What we changed from the original copy

- The chat model had no model set, so n8n would have used its default, `gpt-5-mini`, which OpenAI shuts down on
  11 December 2026. It is now `gpt-5.6-terra`, set in `OpenAI Chat Model`.
- The system prompt is rewritten in new words. It points to a placeholder, `<YOUR_EXAMPLE_POSTS>`, where you paste your own
  posts. It also tells the bot to say so when it does not know, and not to invent facts.
- The webhook path is a neutral `instagram-dm`, and the hidden webhook id from the original is gone.
- The nodes have plain names, such as `Receive Instagram Message`, `Set System Prompt` and `Send Reply`. The wiring is
  unchanged.
- The sticky note is rewritten.

## Before you start

- An n8n that ManyChat can reach over the internet, on n8n Cloud or on a server of your own.
- An OpenAI API key.
- A ManyChat account with your Instagram account connected. Mindket did not check which ManyChat plan allows calls to a
  webhook.
- A few of your own posts or captions to paste into the prompt.

## Set it up

1. In n8n, create a workflow, open its menu and choose Import from File. Pick `workflow.json`.
2. Add an OpenAI credential and select it in `OpenAI Chat Model`.
3. Open `Set System Prompt`. Replace `<YOUR_EXAMPLE_POSTS>` with your own posts, and change the rules if you like.
4. Publish the workflow, open `Receive Instagram Message` and copy its production address.
5. In ManyChat, add a request step that posts JSON to that address. Send a value that is unique to each contact as
   `session_id`, and the contact's last message as `text`. Show the `output` field of the reply as the bot's message.

## How a run goes

1. `Receive Instagram Message` takes the POST and waits for a reply node.
2. `Set System Prompt` builds three fields: the prompt, the chat id from `session_id` and the message from `text`.
3. `AI Agent` sends the message to the model with your prompt as its system message. `Window Buffer Memory` supplies the
   recent turns of that chat and stores the new one under the chat id.
4. `Send Reply` returns the agent's answer as JSON. The text sits in a field called `output`.

## Change the result

- The voice and the rules: the `prompt` field in `Set System Prompt`.
- How many turns it remembers: the context window length in `Window Buffer Memory`.
- The model: `OpenAI Chat Model`.
- The webhook address: the path in `Receive Instagram Message`.

## Good to know

- The webhook is open. Anyone who finds the address can send messages and spend your OpenAI credit. Switch the webhook's
  authentication to a header check, and send the same header from ManyChat if it lets you add one.
- The bot knows only what the prompt tells it. Telling it to admit when it does not know lowers the risk of a made-up
  answer, and does not remove it. Read the first replies before you open it to everyone.
- The memory lives in the n8n process, so a restart clears every chat.
- Each message is one OpenAI call, and the chat text goes to OpenAI.
- No tools are connected to the agent. The model is set to `gpt-5.6-terra` because an agent talks to its model through
  tool calling.
- Mindket did not run this workflow against ManyChat, Instagram or OpenAI. It did not check ManyChat's screens, its limits or
  how long it waits for a reply. The ManyChat steps are described from the shape of the request the workflow expects.
```

## What is in it

3 files, 9 KB, downloaded as a zip.

```text
NOTICE.md  625 B
README.md  4 KB
workflow.json  5 KB
```

## Workflow check

Checked by Mindket on 13 Nov 2026. Read from the workflow’s file, not from a run.

- Steps: 4 steps, starting when its webhook is called
- AI: 1 step calls an AI model: AI Agent
- Sign-ins: Signs in to: OpenAI
- API keys: No API key is left in the file
- Step types: Mindket’s checker reads all 4 of its step types

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/269b4d01-fa0a-44d8-a79d-b8ffd93f18cc)
- [Its page on Mindket](https://mindket.com/p/269b4d01-fa0a-44d8-a79d-b8ffd93f18cc)
