Skip to content

Webhooks: start a workflow Added in v1.2 ​

Every Webhook step in a workflow has its own address. When your system calls it with a JSON event, the workflow starts and every later step can use the event's fields. It works like a webhook node in n8n or Zapier: the call always starts the workflow, and the workflow decides what to do with the data.

The address ​

Open the workflow in the builder and click its Webhook step. Under Address to call you'll find:

  • Webhook address, with a copy button. It looks like this:

    https://<your-app>/api/integrations/hooks/<workflow>/<step>

    <workflow> is the workflow's short name and <step> is the step's ID, for example webhook_1. A workflow can have several Webhook steps, each with its own address.

  • Copy as cURL: a ready-to-run command with the step's example event as the body.

The address starts the published workflow. Publish it before another system calls it. Until then, use Test with this data in the builder (see Testing a workflow).

The request ​

PartValue
MethodPOST
Header x-api-keyA key from Settings › API keys (see API keys). The key decides which project the call is for.
Header Content-Typeapplication/json
BodyThe event: any JSON object.
bash
curl -X POST "https://<your-app>/api/integrations/hooks/order-updates/webhook_1" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customerId": "C-10293",
    "phone": "919812345678",
    "bookingId": "D1234567",
    "status": "OUT_FOR_DELIVERY",
    "eta": "2026-11-21T14:00:00+05:30"
  }'

The body is the event ​

The whole body becomes the run's data. Steps read any field as {{ trigger.data.<field> }}, with dots for nested fields:

In the bodyIn a step
"bookingId": "D1234567"{{ trigger.data.bookingId }}
"customer": { "name": "Asha" }{{ trigger.data.customer.name }}

Flows gives no special meaning to any field except the two person fields below. Send whatever your workflow needs.

Who the event is about ​

Flows looks for the person in two fields of the body:

FieldDefault nameWhat it's used for
Customer IDcustomerIdYour own ID for the customer. It is tried first. A customer seen for the first time is created. Up to 128 characters.
PhonephoneThe WhatsApp number, 8 to 15 digits with the country code. Used when there is no customer ID, or when the customer ID can't be used.
  • Text is safer than a number. Send "phone": "919812345678" rather than "phone": 919812345678. Some JSON tools change long numbers.
  • Spaces, dashes and a leading + are removed.
  • Indian numbers: a 10-digit number like 9812345678 (or 09812345678) is read as 919812345678.
  • Email is not a person field. An event with only an email starts with no contact. A step can still use {{ trigger.data.email }}.

Other field names ​

If your system sends the person under other names, change them on the Webhook step under Who the event is about: Customer ID field and Phone field. Use dots for nested fields, up to five names deep.

Your bodyPhone field
{ "mobile": "919812345678" }mobile
{ "customer": { "mobile": "919812345678" } }customer.mobile

A call always starts the workflow ​

Flows doesn't refuse an event because of who it is about. If the details don't line up, the run still starts and tells the workflow what happened, in trigger.person:

The event has…The run is for…trigger.person.bytrigger.person.code
A customer ID (with a phone that agrees, or no phone)That customercustomer_id
A phone that already belongs to a contact with a different customer IDThe contact with that phonephonecustomer_id_conflict
Only a phoneThat phonephone
A phone that isn't 8 to 15 digitsNo onenonebad_phone
A customer ID longer than 128 charactersThe phone's contact, or no onephone or nonebad_customer_id
NeitherNo onenone

trigger.person.note explains the code in a sentence, for your logs. Customer IDs are never changed or merged by a webhook call.

To handle these cases, put an If step right after the Webhook step, for example "{{ trigger.person.code }} is not empty" → send an alert to your team.

Runs for no one ​

A run with no contact still runs. Message steps send to their own Send to setting, for example {{ trigger.data.phone }}. A message step with no one to send to fails and takes its failure path.

The response ​

A started run answers 201:

json
{
  "ok": true,
  "executionId": "cmwoi6g9s0039okm2299j5omt",
  "status": "RUNNING",
  "person": { "by": "phone" }
}

status is the run's state right after it started: RUNNING, WAITING, or already COMPLETED for a short workflow. person is the same object the workflow reads as trigger.person.

Errors ​

Errors answer with an error sentence ("ok": false too, except the 401), and sometimes a reason code.

StatusWhenWhat to do
400The body isn't a JSON object, or the workflow isn't published.Send a JSON object with Content-Type: application/json. Publish the workflow.
401The x-api-key header is missing or the key is wrong or deleted.Make a new key in Settings › API keys.
404There is no Webhook step at this address in the key's project.Copy the address again from the step.
409, reason: "already_running"The person already has an open run of this workflow.Wait for it to end, or design the workflow so that runs end.
409, a consent reasonThe workflow sends promotional messages and the person opted out or can't be messaged (opted_out, blocked, suppressed, erased, unreachable). A person with no WhatsApp number is not refused: the run starts, and its WhatsApp steps take their failure path.Nothing: this is the person's choice. Don't retry.

Example events in the builder ​

Give the Webhook step an Example event (JSON): a sample of what your system will send. Then:

  • Typing {{ in a later step offers its fields, like trigger.data.bookingId.
  • Test with this data runs the workflow with it, without publishing.
  • Use the last event received fills it from the last real call, with phone numbers and IDs masked.

The example is only for building and testing. Real calls always use the body they send.

Flows documentation for v1.x (v1.7.2).