Create automation rules that run an agent, app, or flow on a schedule or when an external webhook fires.
Triggers are workspace-scoped resources. Cron triggers are evaluated by the platform scheduler on a recurring schedule; scheduled triggers fire once at a configured time; webhook triggers expose a public ingestion URL you can register with external services. Manual triggers have no automatic schedule or webhook ingestion; use POST /triggers/{id}/fire to run them.
→ Entitlements — triggers plan limit
→ Discord integration: OAuth event triggers in the web app
→ GitHub App: run triggers on a GitHub App installation's events, no webhook to set up
Create triggers in the web app
Use Triggers → New to build a trigger without calling the API directly:
- Type — schedule (cron) or webhook
- Action — run an agent, app, or flow (visual pickers)
- Schedule — for cron triggers, use the visual schedule builder: pick a frequency (every N minutes, hourly, daily, weekly, monthly, or custom), set time and day fields in an inline sentence (for example run daily at 09:00), and choose a timezone from the dropdown. Custom mode exposes five labeled cron fields (minute, hour, day, month, weekday) with a live expression preview. For webhook triggers, pick a source: for GitHub, the GitHub App connection it runs on; for another provider, paste the signing secret it issues on the trigger's page once the trigger exists
- Filters (webhook) — optional match rules with operator picker; provider-specific fields come from
GET /trigger-sourcesfilter_fields - Input — default JSON payload or input mapping for webhook events
The trigger list links to a detail page with an activity feed of recent fires. See Execution log for the same data via API.
Scopes
| Scope | Endpoints |
|---|---|
agents:read | List, get triggers; list, get trigger fires |
agents:write | Create, update, delete; generate and reveal a webhook signing secret |
agents:execute | Fire (POST /triggers/{id}/fire) |
Create API keys with these scopes at settings → workspace → api keys.
GET /trigger-sources is public (no API key required).
Trigger object
| Field | Type | Description |
|---|---|---|
id | string | Trigger ID |
name | string | Display name |
type | string | cron, webhook, scheduled (one-shot), or manual |
action | string | run_agent, run_app, or run_flow |
enabled | boolean | When false, cron ticks and webhook ingestion are skipped |
agent_id | string | Required when action is run_agent |
app_id | string | Required when action is run_app |
flow_id | string | Required when action is run_flow |
config | object | Type-specific settings (see below) |
input | object | Default JSON payload when fire requests omit a body |
input_mapping | object | Map webhook payload fields into run input — see Input mapping |
filters | array | Match rules applied before dispatch — see Event filtering |
source | object | Webhook provider metadata (from source_id) |
credential_id | string | The connection a webhook trigger is bound to — see Triggers bound to a GitHub App connection |
scheduled_at | string | RFC3339 one-shot fire time — present when type is scheduled |
last_fired_at | string | ISO timestamp of last successful fire |
fire_count | number | Total successful fires |
webhook_url | string | Present on create for webhook triggers not bound to a connection — your public ingestion URL |
has_webhook_secret | boolean | The trigger holds its own signing secret, used by the inference-v1 scheme (see Webhook signing). Every webhook trigger gets one when it is created or updated. |
config by type
Cron (type: "cron"):
| Field | Type | Required | Description |
|---|---|---|---|
expression | string | Yes | Cron expression (e.g. 0 9 * * *) |
timezone | string | No | IANA timezone for the expression |
Webhook (type: "webhook"): no config. A webhook trigger verifies deliveries with its own signing secret: generated for the generic source or no source_id, or the one a provider issued, set with Set webhook secret. A trigger bound to a GitHub App connection (credential_id) has none. config.secret_ref is refused (400).
Scheduled triggers (type: "scheduled")
Set the top-level scheduled_at field (RFC3339) to the one-shot fire time. The platform checks due scheduled triggers every 60 seconds. After the scheduled time passes, the platform fires the trigger once and sets enabled to false — whether dispatch succeeds or fails. Re-enable the trigger (with a new scheduled_at) to fire again.
List triggers
GET /triggers or POST /triggers/list
Cursor-paginated list of your workspace's triggers. Requires agents:read.
1curl -X POST https://api.inference.sh/triggers/list \2 -H "Authorization: Bearer inf_your_key" \3 -H "Content-Type: application/json" \4 -d '{"limit": 50}'Get trigger
GET /triggers/{id}
Returns a single trigger. Requires agents:read.
Create trigger
POST /triggers
Requires agents:write.
Request
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name |
type | string | Yes | cron, webhook, scheduled, or manual |
action | string | Yes | run_agent, run_app, or run_flow |
agent_id | string | When action is run_agent | Agent to run |
app_id | string | When action is run_app | App to run |
flow_id | string | When action is run_flow | Flow to run |
config | object | For cron | Must include expression (and optional timezone) |
scheduled_at | string | When type is scheduled | RFC3339 one-shot fire time |
source_id | string | No | Webhook provider from trigger sources |
credential_id | string | No | Bind a webhook trigger of the github source to a GitHub App connection — see below |
enabled | boolean | No | Defaults to true |
input | object | No | Default payload |
input_mapping | object | No | Payload field mapping — see Input mapping |
filters | array | No | Match rules before dispatch — see Event filtering |
Cron example — run an app every day at 9:00:
1curl -X POST https://api.inference.sh/triggers \2 -H "Authorization: Bearer inf_your_key" \3 -H "Content-Type: application/json" \4 -d '{5 "name": "daily-report",6 "type": "cron",7 "action": "run_app",8 "app_id": "app_abc123",9 "config": { "expression": "0 9 * * *", "timezone": "America/New_York" },10 "input": { "report_type": "daily" }11 }'Webhook example — run an agent when an external service POSTs:
1curl -X POST https://api.inference.sh/triggers \2 -H "Authorization: Bearer inf_your_key" \3 -H "Content-Type: application/json" \4 -d '{5 "name": "slack-events",6 "type": "webhook",7 "action": "run_agent",8 "agent_id": "agent_abc123",9 "source_id": "<source_id from GET /trigger-sources>"10 }'Then add the trigger's webhook_url in Slack and set the signing secret Slack shows (Set webhook secret). Until then every delivery is refused.
Scheduled example — run an agent once at a specific time:
1curl -X POST https://api.inference.sh/triggers \2 -H "Authorization: Bearer inf_your_key" \3 -H "Content-Type: application/json" \4 -d '{5 "name": "launch-reminder",6 "type": "scheduled",7 "action": "run_agent",8 "agent_id": "agent_abc123",9 "scheduled_at": "2026-08-15T09:00:00Z",10 "input": { "message": "Launch day reminder" }11 }'Response
Returns the created trigger. Webhook triggers include webhook_url — the public URL to register with your provider:
1https://api.inference.sh/triggers/{id}/hookA webhook trigger is created with its own signing secret (has_webhook_secret: true). Read it with Get webhook secret to sign deliveries for the generic source or a trigger with no source_id.
Update trigger
POST /triggers/{id}
Partial update: only fields you include in the JSON body are changed; everything else stays as stored (including cron config when you toggle enabled). Requires agents:write.
Common patch fields:
| Field | Type | Description |
|---|---|---|
name | string | Display name |
enabled | boolean | Pause (false) or resume (true) cron, webhook, and scheduled triggers |
config | object | Cron expression and timezone |
input | object | Default fire payload |
input_mapping | object | Webhook payload mapping |
filters | array | Webhook match rules |
credential_id | string | Bind to, or move to, another GitHub App connection; "" unbinds |
scheduled_at | string | RFC3339 one-shot time for type: scheduled |
Pause a webhook trigger (stops cron ticks and returns 410 on webhook ingestion until re-enabled):
1curl -X POST https://api.inference.sh/triggers/trigger_abc123 \2 -H "Authorization: Bearer inf_your_key" \3 -H "Content-Type: application/json" \4 -d '{"enabled": false}'Returns the updated trigger object (TriggerDTO). An empty body returns 400 invalid_request.
Delete trigger
DELETE /triggers/{id}
Permanently deletes a trigger. Requires agents:write.
Fire trigger (manual)
POST /triggers/{id}/fire
Manually invoke a trigger. Requires agents:execute and write access to the trigger.
Use this to test a trigger or run it on demand. All trigger types support manual fire, including manual triggers that only run on demand.
Request body
Optional JSON object. When omitted or empty, the trigger's configured input is used (if set).
1curl -X POST https://api.inference.sh/triggers/trigger_abc123/fire \2 -H "Authorization: Bearer inf_your_key" \3 -H "Content-Type: application/json" \4 -d '{"event": "manual_test"}'Access and dispatch permissions
Your API key needs agents:execute to call fire, and you need write access to the trigger (the same access as editing it). A trigger you cannot read returns 404; one you can read but not change returns 403.
A manual fire runs as you: the linked agent, app, or flow must be one you can run yourself.
Webhook ingestion (POST /triggers/{id}/hook) runs with the trigger owner's permissions and does not require an API key. It accepts deliveries only for webhook triggers.
Response
Success (200):
1{ "fired": true }Errors: failures use the standard error envelope: 403 / 404 as above, and 500 when dispatch fails (missing agent/app/flow, input mapping error, and so on). A 500 carries only a generic message; the execution log records what went wrong.
Every fire attempt (cron tick, webhook ingestion, or manual fire) is recorded in the execution log. Failed dispatches and filter rejections appear there even when the ingestion endpoint returns 200.
Execution log
The platform records one trigger fire row per attempt — successful runs, dispatch errors, and events dropped by event filtering.
Use this to debug webhook triggers, audit cron runs, and correlate fires with created chats, tasks, or flow runs.
Trigger fire object
| Field | Type | Description |
|---|---|---|
id | string | Fire record ID |
trigger_id | string | Parent trigger |
trigger | object | Optional embedded trigger (included on list/get when preloaded) |
status | string | success, error, or filtered |
payload | object | Incoming webhook body or cron payload (when captured) |
error | string | Dispatch or mapping error message (when status is error) |
duration_ms | number | End-to-end dispatch time in milliseconds |
chat_id | string | Created agent chat (when action is run_agent and dispatch succeeded) |
task_id | string | Created task (when action is run_app and dispatch succeeded) |
flow_run_id | string | Created flow run (when action is run_flow and dispatch succeeded) |
created_at | string | ISO timestamp |
Status values:
| Status | Meaning |
|---|---|
success | Trigger dispatched successfully — linked a chat, task, or flow run |
error | Dispatch failed (missing target, mapping error, permissions, etc.) |
filtered | Payload did not match the trigger's filters — no run created |
List trigger fires
GET /trigger-fires or POST /trigger-fires/list
Cursor-paginated execution log for your workspace's triggers. Requires agents:read.
1curl -X POST https://api.inference.sh/trigger-fires/list \2 -H "Authorization: Bearer inf_your_key" \3 -H "Content-Type: application/json" \4 -d '{5 "limit": 50,6 "filters": [7 { "field": "trigger_id", "operator": "eq", "value": "trigger_abc123" },8 { "field": "status", "operator": "eq", "value": "error" }9 ]10 }'Common filter fields: trigger_id, status, created_at, updated_at. Unknown filter or sort columns return 400. See Cursor pagination.
Response
| Field | Type | Description |
|---|---|---|
items | array | Trigger fire objects |
next_cursor | string | Cursor for the next page |
prev_cursor | string | Cursor for the previous page |
has_next | boolean | More results available |
has_previous | boolean | Previous page available |
Get trigger fire
GET /trigger-fires/{id}
Returns a single execution log entry. Requires agents:read.
Webhook ingestion
POST /triggers/{id}/hook
No authentication required. External services call this URL to fire a webhook trigger.
| Response | When |
|---|---|
200 {"ok":true} | Accepted — dispatch runs asynchronously |
404 | Trigger not found, or the trigger is not a webhook trigger (cron, scheduled, and manual triggers take no deliveries) |
410 | Trigger is disabled |
401 unauthorized | Signature verification failed, or the trigger has no signing secret yet |
500 internal_error | The signing secret could not be read |
400 | Request body exceeds 1 MB or could not be read |
Every delivery must carry a valid signature; nothing unsigned is accepted. The secret depends on the trigger's source:
| Source | Secret | Scheme |
|---|---|---|
No source_id, or generic | The trigger's own generated secret (has_webhook_secret) | inference-v1, see Webhook signing |
| Slack, Stripe, Linear, Discord, Grafana, … | The secret the provider issued, set with Set webhook secret | The source's strategy from GET /trigger-sources (hmac-sha256, slack-v0, ed25519) |
| GitHub, bound to a GitHub App connection | None: the app signs (Triggers bound to a GitHub App connection) | hmac-sha256 |
The request body is passed through as the trigger payload (subject to filters and input_mapping).
Triggers bound to a GitHub App connection
A GitHub App connection is an installation of the inference shell GitHub App. GitHub sends every event of the installation to inference shell, signed with the app's own secret. A webhook trigger with the github source and credential_id set to the connection runs on those events:
- No webhook to set up: no URL to register on the repository and no signing secret to set. The trigger has no
webhook_urlof its own. - Only that installation: a trigger runs on the events of the installation it is bound to, nothing else. Only an owner of the GitHub organization (or the user, for a personal account) can make the connection. Narrow it further with filters on
event,action,repository.full_nameorsender.login. - The same payload: the event body with
event(fromX-GitHub-Event) anddeliveryadded, throughfiltersandinput_mapping, recorded in the execution log. The run starts as the trigger's owner. - Validated:
credential_idmust be a GitHub App connection of the trigger's own workspace, on awebhooktrigger whose source isgithub. Anything else answers400. - Once per delivery: a delivery GitHub sends again (same
X-GitHub-Delivery) within 10 minutes runs nothing a second time. - Stops with the connection: when the app is uninstalled or suspended, the connection is disconnected and its triggers stop until it is connected again.
1curl -X POST https://api.inference.sh/triggers \2 -H "Authorization: Bearer inf_your_key" \3 -H "Content-Type: application/json" \4 -d '{5 "name": "push-to-main",6 "type": "webhook",7 "action": "run_agent",8 "agent_id": "agent_abc123",9 "source_id": "<id of the github source>",10 "credential_id": "<id of the GitHub App connection>",11 "filters": [12 { "field": "event", "operator": "eq", "value": "push" },13 { "field": "ref", "operator": "eq", "value": "refs/heads/main" }14 ],15 "input_mapping": {16 "action": {17 "prompt": { "value": "{{ sender.login }} pushed to {{ repository.full_name }}: {{ head_commit.message }}" }18 }19 }20 }'A GitHub App's deliveries arrive at POST /triggers/hooks/github/{app id}, for inference shell's app and a workspace's own GitHub App alike. It is not an endpoint to call yourself: it answers 401 to anything not signed by its app, and runs only triggers bound to connections made through that app. A bound trigger's own URL (/triggers/{id}/hook) answers 404.
Webhook signing
A delivery to a trigger with no source_id, or with the generic source, is signed with the trigger's own secret:
| Header | Value |
|---|---|
X-Inference-Timestamp | Unix time in seconds |
X-Inference-Signature | v1=<hex HMAC-SHA256(secret, "<timestamp>.<raw body>")> |
A delivery whose timestamp is more than 5 minutes from the server's clock is refused, so a captured delivery cannot be replayed.
1BODY='{"event":"deploy"}'2TS=$(date +%s)3SECRET="$(curl -s https://api.inference.sh/triggers/trigger_abc123/webhook-secret \4 -H "Authorization: Bearer inf_your_key" | jq -r .data.value)"5SIG="v1=$(printf '%s.%s' "$TS" "$BODY" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $2}')"6curl -X POST "https://api.inference.sh/triggers/trigger_abc123/hook" \7 -H "Content-Type: application/json" \8 -H "X-Inference-Timestamp: $TS" \9 -H "X-Inference-Signature: $SIG" \10 -d "$BODY"Provider sources (Slack, Stripe, …) sign with their own headers and algorithms and the secret the provider issued: set it with Set webhook secret.
Get webhook secret
GET /triggers/{id}/webhook-secret
Returns the trigger's signing secret (whsec_…). Requires agents:write and write access to the trigger. Each reveal is audited (trigger.webhook_secret.revealed).
1{ "data": { "value": "whsec_…" } }A trigger with no signing secret answers 404.
Generate webhook secret
POST /triggers/{id}/webhook-secret
Gives a webhook trigger a signing secret when it has none, and returns the trigger. A trigger that already has one keeps it. Requires agents:write and write access to the trigger. A trigger that is not a webhook trigger answers 400 validation_error.
Only a trigger signed with inference-v1 (no source_id, or generic) gets a generated secret; for a provider source it answers 400: set the provider's with Set webhook secret.
Set webhook secret
PUT /triggers/{id}/webhook-secret
Sets the signing secret a provider issued for the trigger's URL (a Stripe endpoint's whsec_…, a Slack app's signing secret), replacing the one there, and returns the trigger. Requires agents:write and write access to the trigger. Audited (trigger.webhook_secret.set). A trigger bound to a connection answers 400.
1curl -X PUT https://api.inference.sh/triggers/trg_abc123/webhook-secret \2 -H "Authorization: Bearer inf_your_key" \3 -H "Content-Type: application/json" \4 -d '{ "value": "whsec_…" }'In the web app, the trigger's page asks for it once the trigger exists.
Event filtering
Webhook triggers can include a filters array. Each rule inspects a field in the parsed JSON payload using dot notation (for example event.type, repository.full_name). All rules must match (AND logic). When any rule fails, the webhook returns 200 {"ok":true} but the trigger does not dispatch.
| Field | Type | Description |
|---|---|---|
field | string | Dot-notation path into the payload |
operator | string | Comparison operator (see below) |
value | string | Expected value (exists ignores this) |
Operators:
| Operator | Matches when |
|---|---|
eq | Field value equals value (string comparison) |
neq | Field value does not equal value |
contains | Field is a string containing value |
prefix | Field is a string starting with value |
exists | Field is present and non-null |
Example — only fire on GitHub pushes to main:
1{2 "filters": [3 { "field": "ref", "operator": "eq", "value": "refs/heads/main" },4 { "field": "action", "operator": "exists", "value": "" }5 ]6}When you set source_id, GET /trigger-sources returns a filter_fields array for that provider — suggested fields with labels, descriptions, and example values for the create UI.
Input mapping
input_mapping transforms the webhook payload into the JSON input passed to the agent, app, or flow. It uses the same shape as flow run inputs: an object with an action key mapping output field names to static values or payload connections.
| Shape | Description |
|---|---|
{ "action": { "<output_key>": { "value": ... } } } | Static literal |
{ "action": { "<output_key>": { "connection": { "nodeId": "trigger", "key": "<path>" } } } } | Extract from payload via dot notation |
| { "action": { "<output_key>": { "value": "text with {{ path }}" } } } | Template: each {{ path }} is filled from the payload (strings as is, numbers and booleans as written, objects and arrays as JSON, missing paths as nothing) |
Paths use dot notation and may index arrays: commits.0.message.
When input_mapping is omitted or empty, the raw webhook body is passed through unchanged.
Agent triggers: when the input has a string prompt field, the agent receives that text as its message. Otherwise it receives the input as JSON.
GitHub event: GitHub names the event only in a header, so GitHub-source triggers add it to the payload: event (from X-GitHub-Event: pull_request, push, issues, issue_comment, ...) and delivery (from X-GitHub-Delivery). Filter on event together with action to pick one kind of delivery, for example event = pull_request and action = opened.
Example — prompt an agent when a PR is opened:
1{2 "filters": [3 { "field": "event", "operator": "eq", "value": "pull_request" },4 { "field": "action", "operator": "eq", "value": "opened" }5 ],6 "input_mapping": {7 "action": {8 "prompt": { "value": "Review PR #{{ number }} in {{ repository.full_name }}: {{ pull_request.title }}" }9 }10 }11}Example — map a GitHub PR webhook into agent input:
1{2 "input_mapping": {3 "action": {4 "title": {5 "connection": { "nodeId": "trigger", "key": "pull_request.title" }6 },7 "repo": {8 "connection": { "nodeId": "trigger", "key": "repository.full_name" }9 },10 "channel": { "value": "#deployments" }11 }12 }13}Given a payload with pull_request.title and repository.full_name, the dispatched input becomes:
1{2 "title": "fix: resolve race condition",3 "repo": "okaris/inference",4 "channel": "#deployments"5}Only nodeId: "trigger" is valid for webhook connections — other node IDs return a mapping error at fire time. Missing payload paths resolve to null.
List trigger sources
GET /trigger-sources
Returns the catalog of webhook providers available when creating triggers. No API key required.
1curl https://api.inference.sh/trigger-sourcesBuilt-in providers:
| Key | Verification | Typical use |
|---|---|---|
github | hmac-sha256 (X-Hub-Signature-256) | Push, PR, and issue events |
slack | slack-v0 | Event subscriptions and mentions |
stripe | hmac-sha256 (Stripe-Signature) | Payment and subscription events |
linear | hmac-sha256 (Linear-Signature) | Issue and comment webhooks |
discord | ed25519 | Slash commands and interactions |
grafana | hmac-sha256 (X-Grafana-Signature) | Alert notifications from Grafana webhook contact points |
generic | inference-v1 (X-Inference-Signature) | Any service, signed with the trigger's own secret (Webhook signing) |
For grafana, enable HMAC on the Grafana webhook contact point (hmacConfig) and set the header name to X-Grafana-Signature so it matches this source. Grafana signs the raw request body with HMAC-SHA256 (hex, no prefix). Set the same value as hmacConfig.secret and as the trigger's signing secret (Set webhook secret).
Each source includes:
| Field | Description |
|---|---|
key | Provider identifier |
name | Display name |
strategy | Signature verification method |
payload_schema | JSON Schema describing expected webhook body fields |
filter_fields | Suggested filter fields with labels and examples for the UI |
connection_provider | Set when the source's events come from an app (github-app): its triggers are bound to a connection (credential_id) and have no URL or secret of their own |
Response example:
1{2 "items": [3 {4 "id": "src_abc123",5 "key": "github",6 "name": "GitHub",7 "strategy": "hmac-sha256",8 "connection_provider": "github-app",9 "payload_schema": { "type": "object", "properties": { "ref": { "type": "string" }, "action": { "type": "string" } } },10 "filter_fields": [11 { "field": "ref", "label": "branch ref", "examples": ["refs/heads/main"] },12 { "field": "action", "label": "action", "examples": ["opened", "closed"] }13 ]14 }15 ]16}Use each source's id as source_id when creating a webhook trigger. For a provider source, set the signing secret the provider issues for the trigger's URL (Set webhook secret). For the generic source, sign with the trigger's own generated secret (Get webhook secret).