Skip to content

Triggers

A trigger is a start contract: it points at a workflow (target_workflow) and defines how a run may start. Workflows own steps and message formats; triggers own invocation.

Files: flows/triggers/*.yaml
Model: TriggerDoc in engine/services/orchestrator/app/workflow_runner.py

Multiple triggers may target the same workflow (for example minimal-http + minimal-scheduled).

Common fields

name: my-trigger
target_workflow: my_workflow
group: General
description: Operator-facing text
example_payloads:
  - name: sample
    payload:
      xml: "<root/>"
invocation:
  type: http   # http | schedule | amqp | … (see below)

HTTP

Public entry via gateway_public_path → Gateway /v1/api/... (or /v1/webhooks/... via edge routes).

Example: flows/triggers/minimal-http.yaml

name: minimal-http
target_workflow: minimal
group: General
invocation:
  type: http
  http_method: POST
  gateway_public_path: /v1/api/minimal
  gateway_auth_mode: none
  policy_chain: []

Other demos:

Trigger Path
weatherstack-current-demo-http /v1/api/examples/weatherstack-current
joke-api-random-demo-http /v1/api/examples/joke-api-random
storage-minio-demo-http /v1/api/integration/storage-minio-demo
variables-provider-test-http /v1/api/examples/variables-provider-test

Attach gateway policies with invocation.policy_chain (ordered refs). See Policies.

Invoke:

curl -X POST http://localhost:8080/v1/api/minimal \
  -H "Content-Type: application/xml" \
  -d '<root/>'

Internal alternative: orchestrator POST /run/{workflow_name}. Gateway POST /v1/run/... is legacy/dev and may be disabled.

Optional: static edge routes under flows/edge-routes/ (e.g. webhooks) — see Deployment and engine Gateway docs.

Schedule

invocation.type: schedule marks the workflow eligible for scheduler ticks. The cron itself lives in flows/schedules/ (cron_expression, payload, workflow, enabled).

Examples:

  • flows/triggers/heartbeat-timestamp-schedule.yaml
  • flows/triggers/minimal-scheduled.yaml
  • flows/triggers/rabbitmq-schedule-every-minute.yaml

Details: Schedules.

AMQP (RabbitMQ)

Message-driven starts use invocation.type: amqp plus triggerFilters (routing key, headers, DSAV topic fields, Event Grid eventType, etc.).

Example: flows/triggers/rabbitmq-queue-ingest-amqp.yaml

name: rabbitmq-queue-ingest-amqp
target_workflow: rabbitmq_queue_ingest_demo
group: Integration/RabbitMQ
invocation:
  type: amqp
  triggerFilters:
    - property: context:amqp.routing_key
      one_of:
        - queue.demo.ingest.1
    - property: header:X-Tenant
      equals: demo

Also see rabbitmq-topic-subscription-amqp, rabbitmq-dsav-topic-receive-amqp, rabbitmq-eventgrid-receive-amqp, and the erpnext-*-amqp triggers.

S3 / MinIO object events

Object-store starts use invocation.type: s3 plus triggerFilters on context:s3.event (created / updated / deleted / moved), context:s3.bucket, context:s3.top_folder, context:s3.suffix.

The s3-trigger-subscriber pod listens to a MinIO eventstream (listen_bucket_notification). Polling is only a fallback when the backend has no notification API. Create/update copies the object to .meshflows-snapshots/<key> so a delete event still has a hidden link (context:s3.snapshot_key) if the workflow is late.

Example: flows/triggers/storage-minio-object-trigger.yaml (inbox .xml/.json, create+update only).

Dashboard / manual

Dashboard “test run” uses the workflow’s (and trigger’s) example_payloads. No separate trigger type is required beyond an HTTP or schedule contract already bound to the workflow.

Not event-triggers in this repo

IMAP and SFTP are not start triggers here. They are used as service_call steps inside a workflow (connections + egress capabilities), often started by HTTP or schedule. See imap_peek_example and SFTP-related demos under flows/workflows/ / connections.