Tasks and runs
Run a task from a webhook
Let another system start a task with an HTTP request and a secret.
A webhook lets another system start a task. For example, your billing system can start a task when a payment fails.
Make a webhook task
- Create a task. See Schedule a task.
- In Triggers, select Webhook.
- Optional: turn on Only run when if the run should wait for an App trigger. See Only run when.
- Finish the task and select Create Task.
Each task also shows its webhook URL on its page, under Webhook.
Get the secret
- Open the task.
- Under Webhook, select Generate secret.
- Copy the secret and keep it in a safe place.
If the task already has a secret, the button shows Rotate secret. Rotate the secret to make a new one; the old secret stops working. To turn off the webhook, select Disable.
The secret lets anyone start this task. Do not put it in code that other people can see. If the secret leaks, generate a new one.

Call the webhook
Send a POST request to the webhook URL with the secret in the Authorization header.
curl -X POST "https://<your-workspace>/api/v1/webhooks/tasks/<task-id>" \
-H "Authorization: Bearer <secret>" \
-H "Content-Type: application/json" \
-d '{"prompt": "Check the failed payment for invoice INV-20418.", "data": {"invoice": "INV-20418"}}'The JSON body is optional:
| Field | Use |
|---|---|
prompt | Use this prompt for this run, instead of the task prompt. |
data | Give extra data to the agent for this run. |
The values apply to this run only.