Create DM automation
create_dm_automationCreate a DM automation on an Instagram account (or a Facebook Page, Messenger): when the trigger fires, Breakreach answers in the DM and walks the steps for that person. It only ever replies to something the person did, within Meta's 24-hour window; one flow per person at a time, and a person on the team answering by hand stops it. Example, follow to get the link: trigger {type:"keyword",keywords:["GUIDE"]}, steps [{type:"condition",check:"follows",yes:[{type:"message",text:"Here it is {username}!",button:{title:"Open the guide",url:"https://..."}}],no:[{type:"message",text:"Follow me first, then tap below",choices:[{label:"I followed",steps:[...]}]}]}].
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | A name for the automation (default: from the trigger) | |
| steps | Yes | Steps run in order; each is one of: - {"type":"message","text":"...","button":{"title":"Get the guide","url":"https://..."}}: text up to 1000 bytes (640 characters with a button). {username} becomes their @handle on Instagram (first name on Messenger), {first_name} their first name. Optional link button (title up to 20 characters); clicks are counted. - {"type":"message","text":"Which one?","choices":[{"label":"Pricing","steps":[...]},{"label":"Demo","steps":[...]}],"otherwise":{"afterMinutes":60,"steps":[...]}}: up to 13 quick-reply choices (labels up to 20 characters), each with its own steps; otherwise = a typed answer that isn't a choice, or no answer within afterMinutes. A message has a button or choices, not both. - {"type":"wait","minutes":30}: up to 1380 (23 h). - {"type":"condition","check":"replied|keyword|clicked|follows","keywords":["yes"],"withinMinutes":60,"yes":[...],"no":[...]}: waits up to withinMinutes for a reply, a reply containing a keyword, or a click on an earlier link button; follows (Instagram only) checks at once whether they follow the account ("follow to get the link"). - {"type":"handoff","note":"Wants a quote"}: flags the conversation in the Breakreach Inbox for a person on the team and ends the flow. A message with choices, a condition and a handoff must be the last step of their list: put what comes next inside their branches. Up to 40 steps, branches 6 levels deep. Meta only allows replies within 24 hours of the person's last message: a message due later is not sent and the run ends. | |
| active | No | false pauses it (people in the flow stop) | |
| reentry | No | once (default) = a person goes through it once; always = every time they trigger it, at most once per cooldownHours | |
| trigger | Yes | ||
| accountId | Yes | Instagram account or Facebook Page id from list_accounts | |
| workspace | No | Workspace slug (optional) | |
| cooldownHours | No | With reentry always: hours before the same person can start it again (default 24) |