Skip to content
Guides

Developers

Workflow API and webhook triggers

Start a workflow from your own system with the API trigger, or from Shopify events with the webhook trigger.

Most workflows start from a channel event, such as a new chat. The API and webhook triggers start a workflow from outside Robylon instead. For all triggers, see Workflow triggers.

How does the API trigger work?

An API Trigger lets your own system start the workflow with an HTTP request. After you add it, the trigger panel shows the API Endpoint and a Sample Payload.

Send a POST request to https://api.robylon.ai/triggers/v2/execute/ with your API key in an X-API-Key header (or Authorization: Bearer YOUR_API_KEY):

{
  "workflow_id": "YOUR_WORKFLOW_ID",
  "channel_app_name": "VOICE",
  "user_inputs": {
    "order_id": "12345"
  },
  "payload": {}
}
  • channel_app_name must be VOICE. The API trigger runs voice workflows only, and other values are rejected.
  • user_inputs fills workflow variables whose names match the keys.
  • payload is optional and is saved in the {trigger_event_payload} variable.

The response returns an execution_id you can look up in Runs. A typical use is placing an outbound call when an order is not delivered. See triggering calls.

How does the webhook trigger work?

A Webhook Trigger starts the workflow when a connected store sends an event. Today this covers Shopify. Choose the Channel, the store under Select an Account if you have more than one, and the event under Webhook Events. Only events with webhooks enabled on that store are listed:

  • Order created
  • Order updated (the workflow runs only for orders that have been delivered)
  • Order cancelled
  • Refund created
  • Customer created
  • Product updated

The order, refund and customer events can each start only one workflow in your workspace. The Webhook Data section shows a Sample Payload of what Shopify sends. The full event is saved in the {trigger_event_payload} variable.