Triggers

Start Task and agent runs from webhooks, schedules, and Gmail.

A Trigger starts a Task or agent run when a configured event occurs or a schedule fires. Trigger configuration and event history belong to the target Project.

This section covers three trigger types:

  • Webhook Triggers expose a public HTTP endpoint with HMAC or bearer-token authentication, payload mapping, and idempotency controls.
  • Schedule Triggers run on a cron expression in a configured timezone and can be enabled, disabled, or given an expiry.
  • Gmail Triggers watch a connected Gmail Integration and start work when a message matches their filters.

Each trigger type records events separately from the Task or agent run it starts. Event endpoints expose the received input, processing outcome, and target run identifiers when available.

All management and event-history endpoints require authentication and are scoped to an Organization and Project. The generated public endpoint for invoking a webhook uses the authentication method configured on that trigger.

Key endpoints

POST
/api/v1/org/:org_id/project/:project_id/trigger/webhook
curl -X POST https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/trigger/webhook \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "helpdesk-inbound",
"auth_method": "hmac_sha256",
"target_type": "task",
"target_id": "0190a234-8dc6-6d08-aea9-928fcecad8f1",
"description": "Fires the summariser when the helpdesk posts a ticket.",
"payload_mapping": {
"text": "$.ticket.body"
}
}'
MethodEndpointPurpose
GETList TriggersList webhook, schedule, and Gmail triggers in a Project.
POSTCreate webhook triggerCreate an authenticated public endpoint targeting a Task or agent.
POSTCreate schedule triggerConfigure recurring execution for a Task or agent.
POSTCreate Gmail triggerStart work from messages received through a connected Gmail Integration.
GETList webhook eventsInspect deliveries and their outcomes for one webhook trigger.