Skip to main content
Overview Trigger conditions let you control which trigger templates execute based on the status of a sensor’s dependencies in Argo Events. A sensor can declare multiple dependencies and multiple triggers; each trigger may include a boolean expression that references dependency names to determine when it should run. This guide explains how condition expressions work, shows examples, and walks through a practical sensor that uses a MinIO event and a webhook to drive two triggers: one that submits an Argo Workflow and another that sends an HTTP request. Relevant links and references Trigger conditions explained
  • Conditions are boolean expressions referencing dependency names defined in the sensor’s dependencies list.
  • Supported operators: && (AND), || (OR). Parentheses are supported for grouping.
  • If a trigger template omits conditions, it defaults to requiring all dependencies (implicit AND across all declared dependencies).
Operators summary Simple example: sensor with three dependencies and three triggers
Example evaluations
  • conditions: "dep02" — trigger runs when dependency dep02 is satisfied.
  • conditions: "dep02 && dep03" — trigger runs when both dep02 and dep03 are satisfied.
  • conditions: "(dep01 || dep02) && dep03" — trigger runs when dep03 is satisfied and at least one of dep01 or dep02 is satisfied.
Practical multi-dependency sensor (MinIO + webhook) Below is a real-world sensor manifest that demonstrates two dependencies and two triggers:
  • hello-workflow-trigger submits an Argo Workflow and only fires when the MinIO dependency is satisfied.
  • http-trigger posts to an external HTTP endpoint and fires when either dependency is satisfied.
Notes about the workflow trigger and RBAC
  • The workflow trigger sets serviceAccountName: workflow-trigger-sa. That service account must have RBAC permissions (Role/ClusterRole and corresponding RoleBinding/ClusterRoleBinding) that allow creating Workflows in the argo namespace.
  • If the trigger uses the default service account (or a service account lacking permissions), the Workflow creation will fail with a permission error.
Testing the configuration
  1. Expose the webhook event source locally (port-forward) and send a test event:
  1. Create a MinIO credentials secret in the argo-events namespace:
  1. Trigger the external HTTP endpoint used by the HTTP trigger (example using httpdump):
Sensor logs and troubleshooting When triggers run or fail, inspect sensor logs to diagnose behavior:
  • Successful HTTP trigger logs (example):
  • RBAC/permission error for Workflow trigger (example):
Fixes:
  • Ensure the trigger template includes serviceAccountName (as shown in the sensor YAML).
  • Grant that service account the necessary RBAC roles to create Workflows in the target namespace.
Event flow and UI A visual graph helps map how event sources, sensors, dependencies, conditions, and triggers relate. The UI shows nodes for event sources, sensors, each dependency, and the triggers that fire when conditions are met.
A screenshot of the Argo Events "Event Flow" web UI showing a visual node graph of event sources, sensors, conditions, and workflow triggers. Visible nodes include labels like "example", "my-webhook", "minio", "webhook-sensor", "multi-dependency-sensor-2", "test-dep", and "hello-workflow-trigger".
When everything is configured and RBAC is correct, triggers will execute and generate expected outputs — for example, HTTP dumps and Argo Workflows. After updating the sensor to include the proper service account, a new workflow should appear in the Argo Workflows list.
A screenshot of the Argo Workflows web UI showing a list of workflow entries with names, namespaces, start/finish times, durations and progress. A left sidebar shows filters and a workflow summary, and the top has buttons to submit new or view completed workflows.
Summary
  • Use dependency names inside conditions expressions to control trigger execution.
  • Use && and || to combine dependency conditions; parentheses support grouping.
  • If conditions is omitted, all sensor dependencies must be satisfied (implicit AND).
  • For Argo Workflow triggers, set serviceAccountName and ensure the service account has RBAC permissions to create Workflows in the target namespace.
Tip: When testing triggers, inspect sensor logs (kubectl -n <ns> logs <sensor-pod>) to see why a trigger did or didn’t execute. Permission errors and missing dependency events are common causes for trigger failures.

Watch Video

Practice Lab