WatificationDocs
Workflows

Workflows: incoming webhooks

Start a workflow when another system sends data to a URL, match a contact, and use the data in messages.

An incoming webhook starts a workflow when your order tool, form, or CRM sends a request to a URL that Watification gives you. You do not need Zapier or Make. Any tool that can send an HTTP POST with a JSON body can start the workflow.

The request matches a contact by phone number, email, or contact ID. Values from the request body become variables, such as {{webhook.order_id}}, that you can use in the workflow's messages and steps.

Before you start

Open Workflows, then open or create a workflow. You need permission to manage workflows to see the URL. Each request needs the workflow to be published and enabled.

Set up the trigger

  1. Open the workflow and select Edit on the trigger card.
  2. In Starts when, choose Incoming webhook.
  3. Enter the rest of the settings in the panel. The URL appears after you save the workflow, because it only exists once the workflow has this trigger saved.
  4. Select Copy to copy the URL, and keep it in your other system's settings.
  5. Add the steps you need, then publish the workflow.

Settings in the trigger panel

SettingWhat to enter
Identifier typeHow to find the contact: Phone number, Email, or Contact ID.
Identifier pathWhere the value sits in the JSON body, such as customer.phone.
Channel for new contactsOptional. Only for phone numbers. When no contact has the number, Watification creates one on this WhatsApp account. Choose Do not create contacts to skip this.
VariablesUp to 10 values to copy from the body. Each has a name and a path.

Identifier path and variable path rules

  • A path is a list of up to 5 parts separated by dots, such as order.customer.phone.
  • Each part uses only letters, digits, and underscores.
  • A variable name starts with a lowercase letter and uses lowercase letters, digits, and underscores. It can be up to 32 characters.

Each variable appears in the workflow's Insert variable menu as Webhook. You can also type it as {{webhook.<name>}}.

Regenerate the URL

Select Regenerate URL and confirm. The old URL stops working at once. Update your other system with the new URL before you regenerate, or the requests fail until you do.

Call the URL

Send a POST request to the URL. Use Content-Type: application/json, and send a JSON object as the body. The example below uses placeholder values. Replace the URL with yours, and send the paths you set in the panel.

Start a workflow from an order
curl --request POST \
  'https://api.watification.com/api/v1/automation/webhooks/YOUR_WEBHOOK_TOKEN' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: order-1001' \
  --data '{
    "customer": { "phone": "+15555550123" },
    "order": { "id": "1001", "total": "250.00" }
  }'

The URL contains a secret token. Anyone who has the URL can start runs, so keep it out of public pages, screenshots, and shared documents.

Request rules

RuleDetail
MethodPOST only.
Content typeapplication/json is required. Other types return 415.
Body sizeAt most 64 KB. A larger body returns 413.
Body shapeA JSON object. Arrays and plain values are not accepted.
IdentifierThe value at the identifier path must be present and match its type.

Variable values

Each variable takes the value at its path. Numbers and true or false values become text, such as "1001" or "true". Objects and arrays at a variable path are skipped. Each value can be up to 1,000 characters.

Responses

A successful request returns 202 Accepted with this body:

{ "accepted": true }

The response means the request was accepted. It does not mean the workflow has finished, and the response does not include run results.

Idempotency

Send an Idempotency-Key header to make retries safe. The key can be up to 128 visible ASCII characters. A repeat request with the same key for the same workflow does not start a second run, and it still returns 202.

Without this header, every request starts a run. Use a key that is unique to each event in your system, such as the order ID.

Contacts and conversations

  • Phone number: Watification changes the number to the +digits form and finds the matching contact. A contact is never duplicated. If no contact matches, the request creates one only when you chose a channel for new contacts.
  • Email: Watification finds a contact with this email.
  • Contact ID: Watification uses the contact with this ID in your workspace.

The run uses the contact's most recently active conversation on any channel. If the contact has no conversation, the run starts without one. Message and question steps then end with the outcome no_conversation.

Error codes

StatusCodeWhat it meansWhat to do
404WORKFLOW_WEBHOOK_NOT_FOUNDThe URL is unknown, or the workflow is not published or not enabled.Check the URL. Publish and enable the workflow, or regenerate the URL if it was shared.
404WORKFLOW_WEBHOOK_CONTACT_NOT_FOUNDNo contact matches, and no channel is set for new contacts.Choose a channel for new contacts, or send an identifier of an existing contact.
413The body is larger than 64 KB.Send fewer fields.
415The content type is not application/json.Set Content-Type: application/json.
422WORKFLOW_WEBHOOK_IDENTIFIER_INVALIDThe identifier is missing, or it has the wrong type or format.Check the identifier path and the value sent.
429WORKFLOW_WEBHOOK_RATE_LIMITEDMore than 60 requests per minute reached this workflow.Wait at least one minute, add jitter, and retry.

Rate limit

A workflow accepts 60 requests per minute. Requests above that return 429 WORKFLOW_WEBHOOK_RATE_LIMITED. Retry only after a short wait, and do not retry in a tight loop.

Limits

  • Conditions on the webhook trigger are not supported. Use a Branch step inside the workflow instead.
  • Requests cannot start runs for conversations or orders. Only contacts are matched.
  • The response does not return run results. Check the run in the workflow's Runs tab.

On this page