---
title: "How to Configure an Instagram Scenario in Scenario Builder"
description: "Instructions for configuring scenarios for different types of Instagram events: Direct, comments, stories, mentions."
---

# How to Configure an Instagram Scenario in Scenario Builder?

Scenarios for Instagram can handle DMs, post comments, story mentions, and @mentions differently. This guide explains how to configure the Router and actions to route events to the correct scenario branches.

## When You Need This

- You need different logic for DMs vs. post comments.
- You want to automatically reply to comments publicly.
- You need to route story mentions and @mentions into separate branches.

## What You Should Know

- **Router** — a node that routes execution to different branches based on conditions.
- **Instagram event types**: Direct (DMs), post comment, story mention, @mention in comment.
- **Public Reply action** — sends a public reply to an Instagram comment (up to 2200 characters).
- Feature is available after platform configuration by the administrator.

## Before You Begin

- [x] You are logged in as integrator or administrator.
- [x] Instagram page is connected to the bot.
- [x] You have an open scenario in Scenario Builder with Instagram as a channel in the start node.

## Step-by-Step Instructions

### 1. Add a Router Node

1. On the canvas, click **«+»**.
2. Select **Router** in the Main category.
3. Connect the start node (Channel Trigger with Instagram) to the Router.
4. Connect the Router to your scenario branches.

### 2. Configure Conditions by Instagram Event Type

1. Click the Router node — Node Inspector opens on the right.
2. Add rules. In the **Field** dropdown, select **Instagram Event Type**.
3. For each branch, set the value:
   - **direct_message** — DMs (messages not from a story)
   - **story_mention** — story mention
   - **post_comment** — comment on a post (including promoted/boosted posts)
   - **mentions** — @mention in a comment
4. Save changes.

> **Note:** Comments on promoted (boosted) posts are handled the same way as regular post comments — the **post_comment** event type applies to both. If your scenario needs to distinguish promoted from organic posts, you can use the `{{instagram_ad_id}}` and `{{instagram_ad_title}}` variables (they are empty for organic posts).

### Post link variable — `{{instagram_post_url}}`

In action fields, **Call Node** data, and scenario constants you can use **`{{instagram_post_url}}`** — a link to the Instagram post related to the event. It is usually filled for comments and @mentions on posts, so you can pass it to the operator or store a direct link to the post.

If no post link is available for the event (for example, the flow is mainly about a story), the value may be empty — then use **`{{instagram_story_url}}`** for story preview and links.

### 3. Add a Public Reply to a Comment (Optional)

If you want to automatically reply to comments in the **post_comment** branch:

1. After the Router, add an **Action** node.
2. Select the **Instagram Public Reply** template.
3. In **Comment ID**, enter `{{instagram_comment_id}}` (variable is substituted automatically).
4. In **Message**, enter the reply text (up to 2200 characters).
5. Save changes.

### 4. Send a DM to the Client (Optional)

After a public reply, you can send a DM. Add the **Instagram Send Direct Message** action with **Comment ID** — the system will send a private message to the client in DMs.

## What Happens Next

The scenario routes Instagram events by type: DMs, comments, story mentions, and @mentions go to their respective branches. Public replies are sent automatically according to your configuration.

## Related Materials

- [Use an action in a scenario](/en/scenariobuilder/how-to/use-action-in-scenario.md)
- [Connect Facebook Messenger and Instagram](/en/channels/how-to/connect-facebook-messenger-instagram.md)
- [Scenario Builder hub](/en/scenariobuilder/integrator-hub.md)
