Workflows
The graph form of an automation (a workflow, also called a flow), its nodes, edges and exits, with a worked example.
A workflow is an automation sent as a graph: nodes (each a catalog type with its config) and edges (which exit of one node leads to which node). A trigger node starts it. Any automation the app draws on its canvas is one.
Build one
- Read the triggers and steps:
get_automation_catalogwithpart=triggersandpart=steps. - Read each step's settings:
list_automation_blockswithfilter=key:eq:<key>&include=input,definition. - Save it switched off:
create_automationwithnameandgraph.validationin the answer says what is still missing, each problem at<nodeId>.<field>. - Change it:
update_automationwithops(add_step, thenconnect) or the wholegraph, withversionfromget_automation. SenddryRun: truefirst. - Check, test and switch on as for any automation (Automations).
Edges and exits
An edge goes from source to target. sourceHandle names the exit it leaves by (a question's answer, a condition's paths, a step's error); null is the step's one plain exit. A step's exits are listed in the catalog (part=steps, exits).
Example
When someone messages PRICE: send the price, ask for their email, then tell the team.
{
"name": "Price, email, tell the team",
"graph": {
"nodes": [
{ "id": "start", "type": "trigger", "config": { "triggerType": "inbound_message", "keywords": ["price"], "matchMode": "word" } },
{ "id": "price", "type": "message", "config": { "blocks": [{ "kind": "text", "text": "Full price list: https://shop.example.org/prices" }] } },
{ "id": "email", "type": "ask_question", "config": { "question": "What is your email? We will send you the details.", "format": "Email", "attribute": "email" } },
{ "id": "team", "type": "notify_team", "config": { "message": "{{contact.name}} asked the price and left their email.", "roles": ["owner", "admin"] } }
],
"edges": [
{ "id": "e1", "source": "start", "target": "price", "sourceHandle": null },
{ "id": "e2", "source": "price", "target": "email", "sourceHandle": null },
{ "id": "e3", "source": "email", "target": "team", "sourceHandle": "answer" }
]
}
}Plain words make the same in one call: create_automation with name and request ("when someone messages PRICE, send the price list, ask for their email, then tell my team").
Try it on real customer chats
Connect Instagram, WhatsApp or any other channel and start replying today.