Skip to main content
Version: v0.17.x

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:

ConditionDescription
WorkflowRunningArgo Workflow is currently executing
WorkflowCompletedWorkflow completed (success or failure)
WorkflowSucceededWorkflow completed successfully
WorkflowFailedWorkflow 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