Triggers
Triggers are LyftData’s registry of curated “run this now” actions. A Trigger is a named invocation with schema-validated parameters that dispatches a message to a target job. It gives teams a safer alternative to handcrafted low-level message traffic for smoke checks, one-off operational workflows, and self-service actions.
When to use Triggers
Section titled “When to use Triggers”Use Triggers when you want:
- a discoverable list of ready-to-run actions;
- parameter validation instead of free-form JSON;
- policy around who can invoke an action; and
- an auditable invocation with a stable
invocation_id.
Use the normal scheduling primitives when work should start on a schedule. Use a typed synchronous-response transport when an external HTTP caller must wait for a workflow result.
How Triggers work
Section titled “How Triggers work”- An admin publishes a Trigger definition with a slug, schema, defaults, and target job.
- A permitted caller invokes the Trigger with parameters.
- LyftData dispatches a tagged
user-generatedmessage to the target job. - The invocation record reports whether dispatch was accepted.
Trigger definitions can be published to the UI, MCP, or both. Server-side authorization and the Trigger invocation policy still apply on every call.
Publish and manage Triggers
Section titled “Publish and manage Triggers”Triggers are curated and revisioned. Admins normally publish and revise them, while users invoke the approved set.
A Trigger definition includes:
- Slug and display name: the stable identifier and user-facing label.
- Parameter schema and defaults: JSON Schema validation and optional defaults.
- Target job and tag: the job that receives the invocation and, where needed, a stable message-filter tag.
- Publication surfaces: UI, MCP, or both.
- Invocation policy: permitted roles and optional per-user rate limits.
The admin API exposes:
POST /api/triggers/publishPOST /api/triggers/<slug>/revisePOST /api/triggers/<slug>/deactivate
Publish a tenant-scoped, dispatch-only Trigger:
{ "slug": "smoke_trigger", "tenant_id": "tenant-a", "display_name": "Smoke trigger", "description": "Dispatch a bounded smoke check.", "parameter_schema": { "type": "object", "properties": { "env": { "type": "string" }, "depth": { "type": "integer", "minimum": 1 } }, "required": ["env"] }, "default_params": { "depth": 1 }, "target_job_name": "smoke_trigger_handler", "target_message_tag": "smoke.invoke", "publication": { "mcp": true, "ui_admin": true, "ui_user": false }, "invoke_policy": { "allow_admin": true, "allow_user": true }}Send the full draft to the revise endpoint; revision is not a patch-in-place
operation. Use tenant_id: "platform" only for a platform-scoped Trigger and
principal.
Dispatch payload
Section titled “Dispatch payload”The target job receives a user-generated message. Its job_event payload has
this top-level shape:
{ "type": "trigger_invoke", "version": 1, "invocation_id": "…", "trigger": { "id": "…", "slug": "smoke_trigger", "revision": 3, "tenant_id": "tenant-a" }, "caller": { "username": "alice", "role": "admin" }, "params": { "env": "prod", "depth": 2 }, "requested_at_ns": 1739370000000000000}In a message-triggered job, read these fields through ${msg|...}. See
Variable Expansion.
Wire up the target job
Section titled “Wire up the target job”Most targets are message-triggered so they run only when invoked:
name: smoke_trigger_handler
input: echo: trigger: message: filter-kind: user filter-type: [user-generated] filter-tag: smoke.invoke json: true event: "{}"Use a dedicated tag namespace, such as smoke.invoke, so the filter remains
stable when other messages share the environment.
Synchronous workflow results
Section titled “Synchronous workflow results”The Trigger registry is dispatch-only for new authoring. When an external HTTP caller must receive a workflow result, use the shared synchronous-response contract:
- The Provider Pack or workflow capability declares
transport_binding.response_mechanism = "synchronous_response". - The transport supplies a bounded synchronous-response context to the workflow.
- A terminal workflow tail emits the typed
response-completeoutput. - The transport returns the correlated result or its bounded timeout outcome to the caller.
The exact workflow and transport definition belongs to the owning Provider Pack or catalog item. Validate its setup journey and receipt contract before publishing it.
Invoke from the UI
Section titled “Invoke from the UI”The Triggers UI is the run-now surface:
- Select an available Trigger.
- Fill in its schema-defined fields.
- Run it and record the returned
invocation_id. - Inspect the target workflow and its receipts for completion evidence.
Invoke over the API
Section titled “Invoke over the API”The API exposes a list, invoke, and status flow:
GET /api/triggers?surface=ui&invokable_only=truePOST /api/triggers/<slug>/invokeGET /api/trigger-invocations/<invocation_id>
Example request:
{ "params": { "env": "prod", "depth": 2 }, "idempotency_key": "smoke-prod-2026-03-13T10:15:00Z", "wait_timeout_seconds": 15, "tenant_id": "tenant-a", "callback": { "url": "https://automation.example/hooks/lyftdata-trigger", "headers": { "authorization": "Bearer …" } }}Practical behavior:
paramsmust be an object;nullis treated as{}.tenant_idis required when the caller has multiple tenant memberships.idempotency_keydeduplicates supported retries for the same tenant, Trigger, caller, and key.wait_timeout_secondsbounds how long the invoke request waits for the current invocation record. It does not wait for workflow completion.
For a successful dispatch-only invocation, the result reports
status: "accepted_for_dispatch" and mode: "dispatch_only".
Callback delivery
Section titled “Callback delivery”When supplied, callback receives best-effort invocation state updates.
Callback delivery is retried on transport errors and retryable HTTP statuses,
but it does not block Trigger dispatch. Treat the callback as notification,
not as proof that the target workflow or provider completed.
{ "version": 1, "event_id": "…", "event_type": "trigger_invocation_state", "emitted_at": 1739370000000000000, "invocation": { "invocation_id": "…", "trigger_slug": "smoke_trigger", "trigger_revision": 3, "tenant_id": "tenant-a", "state": "succeeded", "result": { "status": "accepted_for_dispatch", "mode": "dispatch_only" } }}Invoke from MCP
Section titled “Invoke from MCP”A Trigger published for MCP appears as a dynamically generated tool, for
example trigger_invoke__smoke_trigger.
- Start the MCP server with
--max-tool-tier write. Beta.4 accepts--allow-writeonly as a deprecated compatibility alias. - The Trigger must be published for MCP and invokable by the current identity.
- The tool returns an
invocation_id; usetrigger_invocation_getto inspect the dispatch record. - Reserved control keys are
_idempotency_keyand_wait_timeout_seconds.
Where to go next
Section titled “Where to go next”- Workflows for workflow composition.
- Workflow Checkpoints for supported waiting work.
- Delivery Semantics for acknowledgement, retry, and replay boundaries.
- Messages for the live message stream.
- MCP Overview for MCP authentication and write controls.