Five flow recipes
Five working flow definitions you can paste into the Flows API today: a welcome series, an appointment reminder, support triage, survey collection, and order updates. Each recipe covers the trigger to pick, the fulldefinition JSON, and what a run does.
The Flows overview covers trigger types, node semantics, and edge handles; this page assumes those concepts and goes straight to definitions. Build your first automation flow walks one flow design end to end — this page gives you the other five.
1. Choose the trigger
Every flow starts from exactly one trigger, declared top-level astrigger_type.
Two golden rules before the recipes:
- Gate business-event triggers.
contact.createdfires on API imports and CSV uploads too, not just your signup form. Put a Condition first, or a 50,000-row import tags along behind your welcome SMS. - Variables are flat. Write
{{first_name}}, never{{contact.first_name}}. A placeholder for a missing key renders as an empty string — so a webhook flow referencing a key the caller didn’t post sends an empty body. Validate with Test mode before publishing.
2. Recipe 1 — welcome series
Shape: contact created → gate → welcome SMS → wait 24h → follow-up email. New contacts get an SMS immediately and an email the next day. The condition gate keeps imports and API batches from entering the series.contact.created event starts one run. Runs where source is not signup_form exit at the gate (no has no target, so the run ends cleanly). The 24-hour delay parks the run in waiting status and resumes automatically — long waits never send early. The same series is available in the dashboard’s New Flow template list under Welcome SMS; the API route below adds the import gate and the email step.
3. Recipe 2 — appointment reminder
Shape: booking webhook → confirm-or-reschedule at T-24h → final ping at T-1h. Your booking system POSTs when an appointment is scheduled; the flow fires the webhook intowait_24h (a T-24 reminder, booked appointments get a confirmation request) and then the T-1 ping. Booking-time context carries appointment_at — the delay offsets are scheduled against it.
The two wait nodes are date-relative, so a booking made Monday for Wednesday lands the confirmation message Tuesday, not two days after booking.
{ "appointment_at", "appointment_time", "first_name", "phone", "location", "reschedule_link", "sms_opt_in": "true", ... } to the flow’s webhook URL. Contacts without opt-in exit at the gate. The T-24 message carries the confirm/reschedule call-to-action; the T-1 message is a bare logistics ping on the channel the tenant’s inbox monitors. The dashboard template Appointment Reminder (24h + 1h) is the same skeleton — clone it from New Flow if you’d rather click than curl.
4. Recipe 3 — support triage
Shape: inbound message → classify intent → AI agent answers → complaints escalate to a human. Inbound SMS (or WhatsApp) hits an inbound-routing rule that starts the flow. An AI Classify node routes by intent; the agent handles routine questions; complaints fan out to your team’s escalation webhook; anything unrecognized ends for manual pickup.yes/no handles exist as fallbacks — other and unrecognized classifications end the run when no edge carries them. The webhook node’s body carries execution_id and the sanitized run context, so your helpdesk gets the message text and intent. Webhook URLs must be public; private or internal addresses are rejected. Provision the two agents first — agent_id pointing at a non-existent agent fails the run at that node (with an entry in the step trace), not a graceful fallback.
Routing start: wire the inbound-routing rule to this flow (see Where Flows Fire).
5. Recipe 4 — survey collection
Shape: post-call event → wait → send the survey → responses arrive at your webhook. After a call completes, wait a day, then send the NPS or CSAT survey over SMS. Recipients answer on the hosted page via the single-use token link in the message; each response fires a webhook event you capture at your endpoint.survey_id references a survey you created in the Surveys API; channel accepts sms, whatsapp, email, viber, rcs, or push. A missing or unsupported value skips the node with a skipped output in the step trace — check it in Test mode, because a typo’d channel does not fail the run. Recipients receive the single-use survey link; responses land as survey.nps.response_recorded and survey.csat.response_recorded webhook events, and a low score additionally fires survey.response.detractor. Subscribe to those events (see Webhook Events) to close the loop — page a CSM on a detractor, for example.
6. Recipe 5 — order updates
Shape: commerce webhook → SMS + email fan-out. Your commerce layer (Shopify, a custom storefront, an OMS) POSTs order events — confirmation, shipped, delivered, exception. The flow fans out on both channels. Draw a branch per event stage by chaining a condition on theevent key, or run one flow per stage with its own trigger filter.
order_id, first_name, phone, email, tracking_url, review_link); both messages render those values inline. Every contact gets the SMS; the has_email gate skips the email step for phone-only contacts (an empty email resolves to an empty string, so the test is email != ""). When one flow covers several stages, chain conditions on the event key the storefront posts — order.confirmed, order.shipped, order.delivered.
7. Validate before launch
Three tools, in the order to use them: 1. Structural validation. Check the definition parses and has no obvious wiring mistakes before you test behavior:GET /flows/:id/analytics returns entered / completed / converted counts and the per-node drop-off funnel; GET /flows/:id/ab-results rolls up any abTest node variants with the leading variant. The simulator’s assumed drop-off converges on this history as runs accumulate, so forecasts get sharper over time.
Where to wire webhooks first. A list of every webhook event the platform emits lives at Webhook Events; subscribe at the endpoint in Webhooks and verify the HMAC signature in Webhook Security. For the surveys recipe, the survey-response events are the wire that closes the loop; for failures, flow.execution.failed pages you instead of a silent drop-off.
Next steps
- Flows overview — trigger catalog, node taxonomy, edge semantics
- Build your first automation flow — the design walkthrough for recipe-style flows
- Flow Builder — canvas reference and the template library (New Flow dialog)
- Flow Executions — the step-trace reference for debugging runs
- Webhook Events — every event you can subscribe to