Create an automation from a definition, activate it and prove it with a real test run
flow object is the automation’s definition. The preferred shape is a flat list:
BRANCH step’s conditional steps go under its onSuccessAction / onFailureAction. (A hand-nested tree, where each step sits under the previous one’s nextAction, is also accepted.)
A definition always replaces the whole automation — it is never merged. A trigger with no steps is rejected (no_steps): an automation that does nothing cannot be activated.
Supported triggers (trigger.settings):
{{step_1['body']['field']}} for HTTP steps (their JSON nests under body). Common step shapes: HTTP requests, code transforms, branches, delays, respond steps, and platform actions (send SMS/WhatsApp, start a call, re-queue a lead). The easiest way to learn a step’s exact shape is to read an existing automation with Get automation or apply a template and inspect what it built.
{"trigger": {...}, "steps": [...]} as described above. Max 1 MB.phoneCallEnded, inboundCall, newConversation, and bind_webhook): the assistant this automation attaches to. It starts receiving that assistant’s real events after the test passes. (For the platform triggers, selecting the assistant inside the trigger’s settings.input.assistant also works — the explicit parameter wins.)conversation_ended. Requires assistant_id.true) when the definition contains steps that send messages or emails, start calls, or make non-GET HTTP requests — the test run executes them for real.201 when the automation is active (active / active_untested), 200 when it was built but its test run failed (test_failed), and 422 for a definition that never reached the test run (see error codes below).
null for assistant-event and schedule automations.active — the test run passed; the automation is live (and attached, for assistant events).active_untested — the trigger cannot be fired on demand (schedules, external integrations); the automation is live and armed, and the first real event is the proof.test_failed — the test run failed; the automation was left disabled. Read test.steps for the per-step classification.{"type": "post_call" | "inbound" | "conversation" | "conversation_ended", "assistant_id": <id>, "bound": <bool>}. bound is true only after a green test.422){"message": "...", "error": "<code>"} and nothing is activated. Notable codes: