Running Workflows
WorkflowRuns are how you trigger and track workflow executions. This guide covers creating, monitoring, and managing WorkflowRuns.
Creating a WorkflowRunβ
A WorkflowRun references a Workflow and provides parameter values:
apiVersion: openchoreo.dev/v1alpha1
kind: WorkflowRun
metadata:
name: my-workflow-run-01
namespace: default
spec:
workflow:
name: github-stats-report
parameters:
source:
org: "openchoreo"
repo: "openchoreo"
Apply it:
kubectl apply -f workflowrun.yaml
Parameter Defaultsβ
If a Workflow schema defines default values, you can omit those parameters in the WorkflowRun:
spec:
workflow:
name: github-stats-report
parameters:
source:
org: "myorg"
# repo defaults to "openchoreo"
Monitoring Executionβ
# Watch WorkflowRun status
kubectl get workflowrun my-workflow-run-01 -w
# View detailed status
kubectl get workflowrun my-workflow-run-01 -o yaml
Conditionsβ
WorkflowRuns track execution through conditions:
| Condition | Description |
|---|---|
WorkflowRunning | Argo Workflow is currently executing |
WorkflowCompleted | Workflow completed (success or failure) |
WorkflowSucceeded | Workflow completed successfully |
WorkflowFailed | Workflow failed or errored |
Task Statusβ
The status.tasks field provides a vendor-neutral view of individual workflow steps:
status:
tasks:
- name: checkout-source
phase: Succeeded
startedAt: "2024-01-15T10:28:00Z"
completedAt: "2024-01-15T10:28:30Z"
- name: build-image
phase: Running
startedAt: "2024-01-15T10:28:30Z"
Task phases: Pending, Running, Succeeded, Failed, Skipped, Error.
Cleanupβ
Manual Deletionβ
kubectl delete workflowrun my-workflow-run-01
This automatically cleans up all resources created in the build plane (Argo Workflow, ExternalSecrets, ConfigMaps, etc.).
Automatic TTL-based Cleanupβ
If the Workflow defines ttlAfterCompletion, completed runs are automatically deleted after the specified duration. The TTL is copied from the Workflow to the WorkflowRun at creation time.
See Alsoβ
- Creating Workflows β How to define Workflows
- CI Workflows β Component workflow-specific features
- WorkflowRun API Reference β Full resource specification