Skip to main content
Automate workflow execution with triggers.

Trigger Types

CLI Quick Start

The fastest way to set up scheduling, queuing, and webhooks — no YAML required.

Schedule a Recurring Scan (--as-cron)

Create a cron schedule directly from the run command:
This creates a schedule record in the database. To activate it, start the server:
List created schedules:

Queue a Run for Later (--queue)

Queue a run for deferred processing instead of executing immediately:
Queued tasks are stored in the database with status queued. Process them with:
The server also auto-polls for queued tasks when running (every 30s).

Register a Webhook Trigger (--as-webhook)

Create a webhook URL that triggers a run on demand:
This creates a webhook record and prints the trigger URL. Trigger it with:
Requires enable_trigger_via_webhook: true in osm-settings.yaml and a running server.

Queue Management

Full control over queued tasks via the osmedeus worker queue subcommands.

List Queued Tasks

Create Queued Tasks

An alternative to --queue on osmedeus run:

Process Queued Tasks

The queue runner polls the database every 5 seconds. If Redis is configured, it also listens via BRPOP for lower latency.

Server-Side Queue Polling

The server (osmedeus serve) automatically polls for queued tasks every 30 seconds. Disable with:

Webhook Management

List Registered Webhooks

Displays a table of all registered webhook triggers with their UUIDs, workflow, target, trigger URL, and auth key.

Triggering Webhooks

Webhooks can be triggered via GET or POST:
POST body fields (all optional — defaults come from the registered webhook):

Authentication

If a webhook was registered with --webhook-auth-key, the key must be provided as a query parameter:
Requests without the correct key receive a 401 Unauthorized response.

Webhook Configuration

Webhook triggering must be enabled in osm-settings.yaml:

Server Flags

Relevant flags for osmedeus serve:

Cron Triggers

Execute workflows on a schedule using cron expressions.

Workflow Definition

Cron Expression Format

Common Schedules

Event Triggers

Execute workflows in response to events.

Workflow Definition

Event Topics

Topics support glob patterns for flexible matching:

Event Filters

JavaScript expressions to filter events:
For advanced filtering with utility functions, use filter_functions:
See Event-Driven Triggers for available filter functions.

Event Input Mapping

Two syntaxes are supported: New exports-style syntax (recommended):
Legacy syntax:

Event Template Variables

Event-triggered workflows have access to these template variables:

Watch Triggers

Execute workflows when files change. Uses fsnotify for instant inotify-based file system notifications.

Workflow Definition

Watch Configuration

Debounce

When files are modified rapidly (e.g., during a write operation), multiple events may fire. Use debounce to consolidate rapid changes into a single trigger:
The debounce timer resets on each new file event. The workflow only triggers after the specified duration has passed without new events.

Watch Events

API Management

List Schedules

Create Schedule

Enable/Disable

Trigger Manually

Delete Schedule

Webhook API Endpoints

List registered webhooks (authenticated):
Trigger a webhook (unauthenticated, unless webhook_auth_key is set):

Combined Triggers

A workflow can have multiple triggers:

Event Emission

Emit events from workflows:

Database Storage

Schedules are stored in the database:
Query schedules:

Best Practices

  1. Use descriptive trigger names
  2. Start with disabled triggers during testing
  3. Set reasonable intervals to avoid overload
  4. Use event filters to reduce noise
  5. Monitor trigger execution via event logs
  6. Combine with distributed mode for scale

Troubleshooting

Schedule not running

Events not triggering

Watch not detecting changes

Next Steps