An Instagram comment-to-DM workflow is easier to reason about when it is modeled as a small state machine instead of a chain of marketing messages.
States
comment_receivedpromise_deliveredcontext_providedquestion_askedhuman_replyclosed
The first transition must deliver the value named in the post. Qualification or lead capture should happen only after promise_delivered.
Events and guards
Normalize realistic input: case, whitespace, surrounding words, emoji and duplicate comments. Guard against re-entry so a second comment does not restart an unwanted sequence.
A minimal transition table:
| Current state | Event | Next state |
|---|---|---|
| comment_received | valid keyword | promise_delivered |
| promise_delivered | link sent | context_provided |
| context_provided | optional question sent | question_asked |
| any active state | human reply | human_reply |
| any active state | opt-out or invalid route | closed |
Acceptance tests
- Exact keyword.
- Lowercase keyword in a sentence.
- Duplicate comment.
- Destination opened on mobile.
- Human reply before the optional question.
- Contact source stored correctly.
DMComments supports triggers from comments, story replies, live comments and inbound DMs through Meta’s official Instagram API. Use its preview step to verify each transition before enabling the workflow.
A short automation feels human when every transition respects the event that caused it.
Top comments (0)