Skip to content

How a Flow Runs

This page explains what actually happens between someone commenting and the messages landing — useful when you're debugging why a flow behaved a particular way.

The pipeline

Instagram event  →  webhook  →  queue  →  worker  →  execution  →  messages
   (comment,          (near      (retries    (matching     (the        (Instagram
    DM, live,         instant)   safely)     + sending)    session)     Send API)
    story reply)

Every run is recorded as an execution — one row per triggered conversation, holding who triggered it, the text they sent, where the conversation has got to, and its status.

The gates before matching

An incoming event is dropped before any matching happens when:

CheckWhy
The Instagram account is pausedYour plan doesn't cover it. Nothing is queued for later.
The workspace is out of contact allowanceBetter to stop cleanly than half-run a flow.
The event was authored by the connected accountOtherwise the flow answers its own comment reply forever.
The comment is a reply under another commentOnly top-level comments start automations.
The comment already triggered an executionInstagram allows one private reply per comment, ever.

Matching

Active flows for the account, of the matching trigger type, are checked in turn. A flow is skipped when its media doesn't match, or when none of its keywords appear in the text. An empty keyword list matches everything.

For comment events, the first match wins — the single private reply is spent, so a second flow attempting it would hard-fail anyway. DM and story-reply events have no such limit.

The person is then recorded as a contact. If that would exceed your contact allowance and they're new, the run is abandoned rather than started.

The state machine

An execution moves through four statuses:

StatusMeaning
PendingJust created, or released and running.
WaitingPaused, waiting on the person.
SuccessEvery step delivered.
FailedA send failed; the run stops there.

A Waiting execution is always parked on one of three things:

  • Opener — waiting for the tap on the opening message.
  • Ask-follow — waiting for the person to follow and confirm.
  • Lead form — waiting for the next answer.

Comment and live triggers

1. Public comment reply       (one at random from your list)
2. Opening message            (the ONE private reply, with a quick-reply button)
3. → status: WAITING on OPENER
4. They tap, or send any reply  →  the 24-hour window opens
5. → status: PENDING, response steps run from step 1

If a flow has no response steps, the public comment reply is all it does and the execution completes immediately.

If quick replies are rejected for that private-reply target, the opening message is re-sent as plain text automatically. A typed reply resumes the flow just the same.

DM and story-reply triggers

The person messaged you first, so the window is already open:

  • With an opening message: it's sent as a normal DM with its button, and the flow waits for the tap exactly as above.
  • Without one: the response steps run straight away.

Running the steps

Steps are sent in order, skipping any that are disabled. After each delivered step a checkpoint is written, so nothing is ever re-sent.

Two step types park the execution instead of continuing:

  • Ask to follow — the flow stops until Instagram confirms the follow.
  • Lead form — the flow stops until the last question is answered.

When the last step is delivered the execution is marked Success.

If a send fails

The run is marked Failed and stops there. It is deliberately not retried from the beginning: replaying the whole job would re-deliver every step already sent, and the person would get the flow two or three times over.

Resuming a parked conversation

Two mechanisms bring a waiting execution back to life:

  1. A quick-reply tap. The tapped button carries a payload identifying that exact execution, so the right conversation resumes even if several are open.
  2. A free-text message. Matched to the most recent waiting execution for that person on that account. A lead form consumes it as an answer; an opener treats it as the tap.

A message consumed this way never also falls through to keyword matching — otherwise answering "send me the link" to a lead-form question would fire a DM flow as well.

An ask-follow gate is the exception: it keeps waiting for the button tap, and a plain message flows on to normal matching.

The ask-to-follow check

On tap, InfluDM asks Instagram whether that user follows the account.

  • Yes → the flow continues from the step after the gate.
  • No → the retry message is sent, once. After that the execution stays parked silently. The button still works, so they can follow and tap again later.

Lead-form capture

Questions are sent one at a time. Email and phone questions carry native quick replies that pre-fill what Instagram has on file; optional questions carry a Skip button.

An answer that clearly isn't an email or phone gets one re-ask, then is accepted as typed — nobody gets trapped in a validation loop inside a DM thread.

On the last answer the submission is written to Leads as a snapshot, and the flow continues past the gate.

Follow-ups

When an execution parks at a gate on a comment or live flow, and the flow has follow-ups enabled, a nudge is scheduled for the configured delay. It's cancelled the moment the person progresses, or the flow completes or fails — so it only ever reaches people who genuinely stalled. See Follow-ups.

Editing a flow mid-conversation

Conversations track their place by step position, not step identity. Reordering or removing steps while people are parked mid-flow can send them to a different next step than the one they were expecting.

If a lead-form step or its form disappears while someone is parked on it, the flow recovers by continuing past the gate rather than leaving them stranded.

InfluDM — Instagram comment-to-DM automation