Skip to main content
Version: v5.6.1

opschain triggers

triggers

Manage event-automation triggers: per-project rules that create changes or workflow runs from events. A trigger has a match half — subject, events, scope and conditions — and an action half — action type, action params and a per-minute throttle. The API addresses triggers by row id, but the CLI addresses them as <project>/<code>: a trigger's code is unique within its project. Every verb here needs a server target (--server <url>, OPSCHAIN_SERVER, or the active context).

Each time a trigger matches an event, the outcome is recorded as a firing that settles created (a change or workflow run was made), suppressed (matched but intentionally not acted on, e.g. throttled or discarded) or failed — or sits deferred while a maintenance window parks it. triggers firings lists them; triggers test dry-runs a trigger against a stored event without firing anything.

SubcommandPurpose
opschain docs cli/triggers-listList a project's triggers.
opschain docs cli/triggers-showOne trigger's full definition and newest firings.
opschain docs cli/triggers-createCreate a trigger from a flat YAML attribute file.
opschain docs cli/triggers-updateUpdate parts of a trigger (code is immutable).
opschain docs cli/triggers-enable / opschain docs cli/triggers-disableFlip a trigger's enabled flag.
opschain docs cli/triggers-deleteDelete a trigger and its firings.
opschain docs cli/triggers-firingsList a trigger's firings, filterable by status and age.
opschain docs cli/triggers-discardDiscard one deferred firing before its window releases.
opschain docs cli/triggers-testDry-run a trigger against a stored event, gate by gate.
opschain docs cli/triggers-exportExport a trigger as its nested when/then interchange YAML.
opschain docs cli/triggers-importImport an interchange document through the ordinary create/update path.

Two YAML formats exist on purpose: triggers create and triggers update load a flat attribute file that mirrors the API's writable attributes verbatim, while triggers export and triggers import speak the nested when/then interchange document for backup and change control. Each loader rejects the other's format by name.

See also​

  • opschain docs cli/events — the events triggers match.
  • opschain learn 5.2 (triggers), opschain learn 5.4 (custom events), opschain learn 5.6 (maintenance windows) and opschain learn 8.1 (backup and interchange).