Skip to main content
Version: v0.14.x

WorkflowRun

A WorkflowRun represents a single execution instance of a Workflow in OpenChoreo. While Workflows define the template and parameter schema for what can be executed, WorkflowRuns represent actual executions with specific parameter values. When created, the controller renders and executes the Argo Workflow in the build plane.

note

WorkflowRuns currently support Argo Workflow-based workflows only.

API Version​

openchoreo.dev/v1alpha1

Resource Definition​

Metadata​

WorkflowRuns are namespace-scoped resources.

apiVersion: openchoreo.dev/v1alpha1
kind: WorkflowRun
metadata:
name: <workflowrun-name>
namespace: <namespace> # Namespace for grouping workflow runs

Spec Fields​

FieldTypeRequiredDefaultDescription
workflowWorkflowConfigYes-Workflow configuration referencing the Workflow CR and providing parameter values

WorkflowConfig​

FieldTypeRequiredDefaultDescription
namestringYes-Name of the Workflow CR to use for this execution (min length: 1)
parametersobjectNo-Developer-provided values conforming to the parameter schema defined in the Workflow CR

The parameters field contains nested configuration that matches the schema.parameters structure defined in the referenced Workflow.

Status Fields​

FieldTypeDefaultDescription
conditions[]Condition[]Standard Kubernetes conditions tracking execution state
runReferenceWorkflowRunReference-Reference to the workflow execution resource in build plane

WorkflowRunReference​

FieldTypeDefaultDescription
namestring""Name of the workflow run resource in the target cluster
namespacestring""Namespace of the workflow run resource in the target cluster

Condition Types​

Common condition types for WorkflowRun resources:

  • WorkflowCompleted - Indicates if the workflow has completed (successfully or with failure)
  • WorkflowRunning - Indicates if the workflow is currently executing in the build plane
  • WorkflowSucceeded - Indicates if the workflow execution completed successfully
  • WorkflowFailed - Indicates if the workflow execution failed or errored

Examples​

Docker Build WorkflowRun​

apiVersion: openchoreo.dev/v1alpha1
kind: WorkflowRun
metadata:
name: generic-workflow-run-docker-build-01
spec:
workflow:
name: generic-workflow-docker-build
parameters:
repository:
url: "https://github.com/openchoreo/sample-workloads"
revision:
branch: "main"
appPath: "/service-go-greeter"
docker:
context: "/service-go-greeter"
filePath: "/service-go-greeter/Dockerfile"

Docker Build with Specific Commit​

apiVersion: openchoreo.dev/v1alpha1
kind: WorkflowRun
metadata:
name: generic-workflow-run-docker-build-02
spec:
workflow:
name: generic-workflow-docker-build
parameters:
repository:
url: "https://github.com/openchoreo/sample-workloads"
revision:
branch: "main"
commit: "a1b2c3d4"
appPath: "/service-go-greeter"
docker:
context: "/service-go-greeter"
filePath: "/service-go-greeter/Dockerfile"

Integration Test WorkflowRun​

apiVersion: openchoreo.dev/v1alpha1
kind: WorkflowRun
metadata:
name: integration-test-run-01
spec:
workflow:
name: integration-tests
parameters:
repository:
url: "https://github.com/myorg/test-suite"
branch: "main"
testCommand: "npm run test:integration"
environment: "staging"

Minimal WorkflowRun Using Defaults​

apiVersion: openchoreo.dev/v1alpha1
kind: WorkflowRun
metadata:
name: simple-workflow-run
spec:
workflow:
name: generic-workflow-docker-build
parameters:
repository:
url: "https://github.com/myorg/hello-world"
# Uses default values for other parameters from Workflow schema

Status Example​

After execution, a WorkflowRun status might look like:

status:
conditions:
- type: WorkflowCompleted
status: "True"
lastTransitionTime: "2024-01-15T10:30:00Z"
reason: WorkflowSucceeded
message: Workflow has completed successfully
observedGeneration: 1
- type: WorkflowRunning
status: "False"
lastTransitionTime: "2024-01-15T10:29:30Z"
reason: WorkflowRunning
message: Argo Workflow running has completed
observedGeneration: 1
- type: WorkflowSucceeded
status: "True"
lastTransitionTime: "2024-01-15T10:30:00Z"
reason: WorkflowSucceeded
message: Workflow completed successfully
observedGeneration: 1
runReference:
name: generic-workflow-run-docker-build-01
namespace: openchoreo-ci-default

Annotations​

WorkflowRuns support the following annotations:

AnnotationDescription
openchoreo.dev/display-nameHuman-readable name for UI display
openchoreo.dev/descriptionDetailed description of the workflow run