Sevro

Triggers

Configure triggers to start workflows on record events, webhooks, schedules, or manual execution.

What are triggers?

Triggers define what starts a workflow. Every workflow has exactly one trigger. When the trigger fires, the workflow begins executing.

Trigger types

Record event

Fires when a record is created, updated, or deleted. Optionally filtered by a CEL condition.

trigger:
  type: record_event
  entity: invoice
  event: updated
  condition: "record.status == 'paid'"
FieldDescription
entityThe entity ref to monitor
eventcreated, updated, or deleted
conditionOptional CEL expression. The workflow only fires if this evaluates to true.

The triggered workflow receives the record data as input, including record (the current state) and before (the previous state, for updated events).

Webhook

Fires when an external service sends an HTTP POST to a Sevro webhook endpoint. Sevro verifies the HMAC-SHA256 signature and evaluates a CEL transform against the parsed JSON body.

trigger:
  type: webhook
  transform: |
    {
      "customer_email": body.customer.email,
      "amount": body.payment.amount,
      "invoice_id": body.payment.metadata.invoice_id
    }

The webhook URL is generated when the workflow is applied. The transform expression maps the incoming webhook payload to the workflow's input.

Schedule

Fires on a recurring schedule using cron syntax.

trigger:
  type: schedule
  cron: "0 9 * * *"

This runs the workflow every day at 9:00 AM. The workflow receives the scheduled time as input.

Manual

Fires when a user explicitly executes the workflow via the CLI or API. No configuration needed — the trigger is simply type: manual.

sevro workflow execute \
  --module <module-id> \
  --workflow my-workflow \
  --input '{"key": "value"}'

Combining triggers with conditions

Triggers can include CEL conditions to filter when they fire. This lets you build precise automation:

# Only notify when a high-value invoice is paid
trigger:
  type: record_event
  entity: invoice
  event: updated
  condition: "record.status == 'paid' && record.amount > 1000"

Next steps

On this page