# Workflow API and Webhook Triggers in Robylon

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

> Source: https://www.robylon.ai/docs/developers/workflow-triggers
> Section: Developers

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](https://www.robylon.ai/docs/product/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](https://www.robylon.ai/docs/developers/api-keys) in an `X-API-Key` header (or `Authorization: Bearer YOUR_API_KEY`):

```json
{
  "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](https://www.robylon.ai/docs/product/runs). A typical use is placing an outbound call when an order is not delivered. See [triggering calls](https://www.robylon.ai/docs/voice/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.
