> This is a page from the ElevenLabs documentation. For an index of the documentation, fetch https://elevenlabs.io/docs/llms.txt.

# Triggers

Every routine has one trigger. The trigger starts each run and provides the run's input. A trigger only fires while the routine is enabled, and it always runs the published version.

> **Info**
>
> Routines are in beta and not yet available in every workspace. To request access, contact your
> account manager.

Once a routine is published, **Run now** in the editor header starts a run of the published version with any trigger, using input you fill in.

## Manual run

A manual run trigger never starts a run on its own. Define the run's input fields on the trigger, and **Run now** asks for their values.

![Run now dialog asking for a manual run trigger's input
fields](/docs/_fern-files/_img/59f7519bd680a89c855cbc074e5ecb274e5d5201db60442a6d0ec0eb84ea8c2d.webp)

## Schedule

A schedule trigger runs the routine on a repeating schedule, in the time zone you choose: hourly, daily, on weekdays, weekly, or monthly at a time you set, or on a **Custom (cron)** expression for anything else. The trigger shows the next run times as you edit.

![Schedule trigger set to run weekly on Monday at 09:00 London
time](/docs/_fern-files/_img/aff65483575de07bf85779fe2db1d4c87cae04ecc1dce75afeefa41a533630c6.webp)

Each run's input is the time it was scheduled for:

```json
{
  "scheduled_time": "2026-12-08T09:00:00+00:00"
}
```

## Incoming webhook

An incoming webhook trigger lets another system, such as your CRM or helpdesk, start a run by sending a request with its own data.

#### Generate the secret

In the trigger's settings, select **Generate secret**.

#### Configure the sender

Copy the webhook URL shown on the trigger, and the secret, into the system that sends requests.

#### Capture a sample (optional)

With the routine turned off, select **Listen for a sample request** and send a request. The
editor fills in the trigger's input fields from its body. A request sent while the editor is
listening is captured instead of starting a run.

![Incoming webhook trigger with its webhook URL, secret, and input
parameters](/docs/_fern-files/_img/82589b4923aeac7ad6eb5fb0102e3d413da9ca9d2a2738e0c8e9b16a84bdb93f.webp)

Send the secret in the `X-Webhook-Secret` header and the run's input as a JSON body. Routines have no SDK support yet, so call the webhook URL directly:

```python
import os

import requests
from dotenv import load_dotenv

load_dotenv()

response = requests.post(
    "https://api.elevenlabs.io/v1/convai/routines/routine_6801m6ngj6hafeftf8shk12jzfzd/webhook",
    headers={"X-Webhook-Secret": os.getenv("ROUTINE_WEBHOOK_SECRET")},
    json={"customer_id": "cus_8Hk2pQ", "appointment_time": "2026-12-03T15:00:00Z"},
)
response.raise_for_status()
print(response.json()["routine_run_id"])
```

```typescript
import "dotenv/config";

const response = await fetch(
  "https://api.elevenlabs.io/v1/convai/routines/routine_6801m6ngj6hafeftf8shk12jzfzd/webhook",
  {
    method: "POST",
    headers: {
      "X-Webhook-Secret": process.env.ROUTINE_WEBHOOK_SECRET,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ customer_id: "cus_8Hk2pQ", appointment_time: "2026-12-03T15:00:00Z" }),
  }
);
if (!response.ok) {
  throw new Error(`Failed to start the run: ${response.statusText}`);
}
const { routine_run_id } = await response.json();
console.log(routine_run_id);
```

**`cURL`**

```bash title="cURL"
curl -X POST "https://api.elevenlabs.io/v1/convai/routines/routine_6801m6ngj6hafeftf8shk12jzfzd/webhook" \
  -H "X-Webhook-Secret: $ROUTINE_WEBHOOK_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"customer_id": "cus_8Hk2pQ", "appointment_time": "2026-12-03T15:00:00Z"}'
```

The body must be a JSON object of at most 256 KB, and it becomes the run's input. The endpoint responds with one of these statuses:

| Status | Meaning                                                                                                           |
| ------ | ----------------------------------------------------------------------------------------------------------------- |
| `202`  | The run started. The response has `routine_run_id`.                                                               |
| `400`  | The body isn't a JSON object, or a required input field is missing. No run starts, and the error names the field. |
| `401`  | The secret is missing or wrong.                                                                                   |
| `403`  | The routine can't run as the member who published it.                                                             |
| `409`  | The routine isn't turned on with this trigger.                                                                    |
| `413`  | The body is larger than 256 KB.                                                                                   |
| `429`  | Too many requests: over the routine's 60 a minute, or the workspace's 1,000 runs an hour.                         |

> **Warning**
>
> Anyone with the secret can start runs with any input, including values your steps use, such as a
> number to call. If it leaks, regenerate it from the trigger. Regenerating replaces the value in
> place, so update your sender at the same time.

## Conversation ended

A conversation ended trigger starts a run when a conversation with one of the selected agents ends, once its analysis has finished. The run's input is the conversation, with its [data collection](/docs/eleven-agents/customization/agent-analysis/data-collection) and [success evaluation](/docs/eleven-agents/customization/agent-analysis/success-evaluation) results:

```json
{
  "conversation_id": "conv_0501k6qxbw7fe6v9z3h0r2m8ct4d",
  "agent_id": "agent_7101k5zvyjhmfg983brhmhkd98n6",
  "agent_name": "Support agent",
  "status": "done",
  "metadata": {
    "start_time_unix_secs": 1764836400,
    "call_duration_secs": 184
  },
  "analysis": {
    "call_successful": "success",
    "transcript_summary": "The customer asked to move their delivery to Friday. The agent confirmed the new date.",
    "call_summary_title": "Delivery moved to Friday",
    "evaluation_criteria_results": {
      "resolved": {
        "criteria_id": "resolved",
        "result": "success",
        "rationale": "The agent changed the delivery date as requested."
      }
    },
    "data_collection_results": {
      "email": {
        "data_collection_id": "email",
        "value": "jane.doe@example.com",
        "rationale": "The customer gave their email address to receive the confirmation."
      }
    }
  },
  "transcript": [
    { "role": "agent", "message": "Hi, how can I help you today?", "time_in_call_secs": 0 },
    { "role": "user", "message": "I'd like to move my delivery to Friday.", "time_in_call_secs": 4 }
  ]
}
```

For example, to send a follow-up email, set the step's recipient to the trigger's `analysis.data_collection_results.email.value`.

![Conversation ended trigger with an agent selected and conversation fields saved to
variables](/docs/_fern-files/_img/05d86bf55fd6456dde34cbbc6c7688f324ea48af9a6a07760950f19d9d23a919.webp)

## When a trigger doesn't start a run

* The routine is turned off, or hasn't been published.
* The workspace is over its 1,000 runs an hour. A scheduled run is recorded as **Stopped**, and a webhook request gets a `429`.
* A schedule's previous run is still going, or its time was missed by more than a minute.
* A webhook request arrives while the editor is listening for a sample.
* The conversation is encrypted or in Zero Retention Mode, or it already started this routine.
* The member who published the routine lost access to something it uses. The routine is also turned off.