Skip to content

Triggers

A trigger starts a workflow run on your cluster: by hand, on a cron schedule, from a webhook, on a GitHub push or from an AWS SNS message. Triggers need a connected cluster, which needs Production or Business. Every run shows up in the Runs panel with its logs and result.

Click the gear icon and choose Triggers (at /triggers). The list has every trigger your team has, grouped under the workflow each one runs, and Workflow narrows it to one. Opening it from a trigger on the canvas starts it on that workflow.

Click New trigger and pick the Workflow it runs. Then pick the Cluster (only online ones are listed) and the Namespace. If the cluster runs more than one Argo Workflows instance, fill in Argo instance (optional). Then pick a Type from the ones below.

A workflow can have any number of triggers. Each row shows when it last ran, when it runs next and its last error, so a broken one stands out. Last run opens that run, and a last error links to Clusters, where an offline cluster is usually the cause. SNS triggers and Run now don’t update these.

Under each row are its id (such as #1a2b3c4d, which a run started by the trigger also shows), Run now, Parameters and Edit. Edit opens the same form with the namespace, Argo instance, schedule and concurrency choice editable. A trigger’s workflow, cluster and type stay as they were created, so to change one of those, make a new trigger and delete the old one.

Run on the canvas runs the workflow now. To choose where, open Where this runs from the arrow beside Run and rank the clusters and namespaces it may use. The run goes to the highest-ranked one that can take it (see the run queue). With nothing ranked, it goes to the first online cluster’s argo namespace.

A Manual (Run now) trigger pins the cluster and namespace. Every trigger has Run now, which starts a run on its cluster and namespace straight away, whatever its type. Click Parameters first to fill in values for that run, which go into its arguments.parameters. Blank ones use the workflow’s defaults. Anyone who can read the run can read these values, so pass credentials through a Kubernetes Secret instead.

A Schedule (Dagweave starts each run) trigger runs the workflow on a five-field cron expression that Dagweave keeps, such as 0 * * * * for hourly. There’s no timezone setting.

Choice What happens
Run anyway Starts the new run next to the old one. This is the default.
Skip this one Doesn’t start a run this time. The trigger’s last error reads “skipped this run because the last one from this trigger is still going”. The next scheduled time tries again.
Stop it and start again Stops the last run, then starts the new one. A run still waiting in the run queue is taken out of it. If Dagweave can’t stop the last run, it doesn’t start the new one, and the last error says why.

These match a CronWorkflow’s concurrencyPolicy (Allow, Forbid, Replace), and the API calls the field concurrencyPolicy too. Only runs from this trigger’s schedule count. Run now, other triggers and canvas runs always start.

Stopping works like Stop run in the run view: Argo stops the run, runs its exit handlers and marks it Failed.

If you’d rather the cluster kept the schedule, deploy the workflow as an Argo CronWorkflow. In the workflow settings, under Output, set Output kind to CronWorkflow. It’s already set if you started the canvas from a schedule trigger. You then get these fields:

Field What it sets
Schedule The cron expression
Timezone The timezone the schedule runs in
Concurrency policy Default, Allow, Forbid or Replace: what happens when a run is due while the last one is still going
Starting deadline (seconds) Skip a run that’s missed by more than this
Keep successful runs How many successful runs the cluster keeps
Keep failed runs How many failed runs the cluster keeps
Schedule state Active, or suspended with no runs

The main button becomes Deploy schedule, and Run moves under the arrow. Deploy schedule applies any WorkflowTemplates the canvas uses, then the CronWorkflow, to your first choice in Where this runs or the first online cluster’s argo namespace, and says which cluster and namespace it used. With no cluster connected, it asks you to connect one. If the schedule would run more often than your plan allows, the message says so.

After that, Argo owns the schedule, as if you’d applied it yourself. The arrow beside Deploy schedule shows where it’s deployed, and Remove schedule there deletes the CronWorkflow from the cluster. A removed schedule stops counting against your plan. If the cluster is offline, the delete waits until it reconnects. If the cluster has been removed from Dagweave, you have to delete the CronWorkflow on the cluster yourself, and the message names it.

Its runs show up as runs you didn’t start, under Not started from Dagweave in the Runs panel, and a failed one sends the usual failure alert. Dagweave knows which workflow each one came from, so they’re also listed under that workflow’s runs for anyone who can see runs from that cluster, and the run view links back to the workflow. You can’t re-run them or stop them from Dagweave.

A Webhook (external POST) trigger gives you a URL. POST to it from a CI job or another service and the workflow runs.

Dagweave shows the secret once. The URL stays on the trigger’s row under Copy URL. If you lose the secret, click New secret on the row: the old one stops working at once and the new one is shown once, and the URL doesn’t change. Send the secret in the X-Dagweave-Webhook-Secret header:

Terminal window
curl -X POST "$url" \
-H "X-Dagweave-Webhook-Secret: $secret" \
--data '{"environment": "staging"}'

Top-level string, number and boolean fields in a JSON body become run parameters. Nested objects and arrays are ignored. Bodies can be up to 64 KiB. A successful call returns 202 with the new runId.

To stop anyone replaying a captured request, tick Require signed requests (HMAC) when you create the trigger. You get a signing key instead of a secret, shown once. New signing key on the row replaces it the same way New secret does. On an unsigned webhook, New signing key switches it to signed requests. You can’t turn signing off later.

Send two headers. X-Dagweave-Timestamp is the current Unix time in seconds. X-Dagweave-Signature-256 is the hex HMAC-SHA256 of the timestamp, a . and the raw body, keyed with the signing key:

Terminal window
ts=$(date +%s)
sig=$(printf '%s.%s' "$ts" "$body" \
| openssl dgst -sha256 -hmac "$signingKey" -hex | sed 's/^.* //')
curl -X POST "$url" \
-H "X-Dagweave-Timestamp: $ts" \
-H "X-Dagweave-Signature-256: $sig" \
--data "$body"

Dagweave rejects a timestamp more than 300 seconds off its clock and accepts each signature once.

A GitHub push trigger runs the workflow on a push to a branch. Pick the repository and branch from the ones your team’s Dagweave GitHub App can see. Dagweave checks each delivery’s signature before it starts a run.

The API also takes pull_request and tag events for GitHub triggers. The Triggers screen only makes push triggers.

An AWS SNS (topic notification) trigger runs the workflow when a message arrives on a topic. Enter the topic’s ARN and create the trigger. In the AWS console, add an HTTPS subscription to the topic with the receiver URL Dagweave shows. It’s also on the trigger’s row under Copy URL. Dagweave confirms the subscription itself, and there’s no secret.

Dagweave drops any message whose TopicArn doesn’t match yours, or that isn’t signed with an AWS SNS certificate from sns.<region>.amazonaws.com.

The API has one more type, s3, which runs a workflow when an S3 event notification arrives through SNS. The Triggers screen doesn’t offer it yet, so create it with POST /api/v1/triggers: set "type": "s3", an s3Bucket and an snsTopicArn, plus the workflowId, connectorId and namespace every trigger needs. s3Prefix and s3Suffix narrow which objects count.

The run history shows each run’s source, or the person’s email for a manual run. Open a run to see which trigger started it: its type, its schedule, branch or topic, and the id the Triggers list shows.