Skip to main content
POST
Create Trigger

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspace
string
required

Slug of the workspace the request acts in

Maximum string length: 120
Pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$

Body

application/json

Payload for creating a trigger on an existing agent.

agent_id
string<uuid>
required

UUID of the agent to invoke when the trigger fires.

name
string
required

Human-readable trigger name.

Required string length: 1 - 255
trigger_type
enum<string>
required

'cron' for scheduled, 'stream' to run on the events of a stream (a webhook or a polled provider is a source of a stream).

Available options:
cron,
stream
batch
TriggerBatchWindow · object | null

Fire once for a batch of events instead of once per event: {"window": "1h", "max_events": 50} fires when the hour has passed or 50 events joined, whichever comes first. Null fires on every event.

conditions
Conditions · object

Optional conditions evaluated against event data before firing. An LLM condition ({"type": "llm", "description": ...}) must name the chat or decision model instance that evaluates it in "model_id"; each sub-condition of a combined condition names its own.

cron_expression
string | null

5- or 6-field cron expression (required when trigger_type='cron').

description
string
default:""

Short summary of what this trigger does.

Maximum string length: 1000
enabled
boolean
default:true

Whether the trigger is active immediately on creation.

event_filter
Event Filter · object | null

Which events of the stream fire it: {"kinds": ["push"], "fields": {"raw_data.action": "opened"}}. Empty means every event.

failure_threshold
integer
default:5

Auto-disable after this many consecutive failed executions.

Required range: 1 <= x <= 100
session
TriggerSession · object | null

What the next event of the same session does: {"continue": true, "idle_timeout": "30m"} joins the running task. Null takes the source type's default.

stream_id
string<uuid> | null

Stream whose events fire this trigger (required when trigger_type='stream').

task_definition_id
string<uuid> | null

Saved task the trigger runs, of the same agent: its text and parameters are what each firing asks, in place of task_parameters.

task_parameters
Task Parameters · object

Parameters merged into the task created when the trigger fires.

timezone
string
default:UTC

IANA timezone for cron evaluation (e.g. 'UTC', 'America/New_York').

Response

Successful Response

Response model for trigger data.

agent_id
string<uuid>
required
conditions
Conditions · object
required
consecutive_failures
integer
required
created_at
string<date-time>
required
created_by
string
required
description
string
required
failure_threshold
integer
required
id
string<uuid>
required
is_active
boolean
required
name
string
required
status
enum<string>
required

'needs_owner' when the person who configured it can no longer run its agent; the trigger stays stopped until it is enabled again, and the next event re-checks that person's access.

Available options:
active,
inactive,
needs_owner
task_parameters
Task Parameters · object
required
trigger_type
string
required
updated_at
string<date-time>
required
batch
TriggerBatchWindow · object | null

The batch window it fires per; null fires on every event.

cron_expression
string | null
event_filter
Event Filter · object | null

Which events fire it.

last_event_at
string<date-time> | null

When the trigger's stream last recorded an event.

last_execution_at
string<date-time> | null
needs_new_owner_at
string<date-time> | null
next_run_time
string<date-time> | null
session
TriggerSession · object | null

What the next event of the same session does; null takes the defaults.

stream_id
string<uuid> | null

Stream whose events fire this trigger.

task_definition_id
string<uuid> | null

Saved task each firing asks, in place of task_parameters.

timezone
string | null