WorkflowRun
A WorkflowRun represents a runtime execution instance of a Workflow in OpenChoreo. While Workflows define the template and schema for what can be executed, WorkflowRuns represent actual executions with specific parameter values and context. WorkflowRuns bridge the gap between developer intent and CI/CD execution, providing a simplified interface for triggering builds, tests, and automation tasks.
WorkflowRuns currently support Argo Workflow-based workflows only.
API Versionβ
openchoreo.dev/v1alpha1
Resource Definitionβ
Metadataβ
WorkflowRuns are namespace-scoped resources that must be created within an Organization's namespace.
apiVersion: openchoreo.dev/v1alpha1
kind: WorkflowRun
metadata:
name: <workflowrun-name>
namespace: <org-namespace> # Organization namespace
Spec Fieldsβ
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
owner | WorkflowOwner | No | - | Optional owner information identifying the Component that triggered this run |
workflow | WorkflowConfig | Yes | - | Workflow configuration referencing the Workflow CR and providing schema values |
WorkflowOwnerβ
Owner information is optional and used for component-bound workflows to establish the relationship between builds and components.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
projectName | string | Yes | - | Name of the project (min length: 1) |
componentName | string | Yes | - | Name of the component (min length: 1) |
WorkflowConfigβ
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | - | Name of the Workflow CR to use for this execution (min length: 1) |
schema | object | No | - | Developer-provided values conforming to the schema defined in the Workflow CR |
The schema field contains nested configuration that matches the schema structure defined in the referenced Workflow.
Status Fieldsβ
| Field | Type | Default | Description |
|---|---|---|---|
conditions | []Condition | [] | Standard Kubernetes conditions tracking execution state |
imageStatus | WorkflowImage | - | Information about the built image (for build workflows) |
runReference | WorkflowRunReference | - | Reference to the workflow execution resource in build plane |
WorkflowImageβ
| Field | Type | Default | Description |
|---|---|---|---|
image | string | "" | Fully qualified image name (e.g., registry.example.com/myapp:v1.0.0) |
WorkflowRunReferenceβ
| Field | Type | Default | Description |
|---|---|---|---|
name | string | "" | Name of the workflow run resource in the target cluster |
namespace | string | "" | Namespace of the workflow run resource in the target cluster |
Condition Typesβ
Common condition types for WorkflowRun resources:
Ready- Indicates if the workflow run has completed successfullyRunning- Indicates if the workflow is currently executingFailed- Indicates if the workflow execution failed
Examplesβ
Docker Build WorkflowRunβ
apiVersion: openchoreo.dev/v1alpha1
kind: WorkflowRun
metadata:
name: customer-service-build-1
namespace: default
spec:
owner:
projectName: my-project
componentName: customer-service
workflow:
name: docker
schema:
repository:
url: https://github.com/myorg/customer-service
revision:
branch: main
commit: abc123
appPath: .
secretRef: github-credentials
docker:
context: .
filePath: ./Dockerfile
Google Cloud Buildpacks WorkflowRunβ
apiVersion: openchoreo.dev/v1alpha1
kind: WorkflowRun
metadata:
name: frontend-build-v2
namespace: default
spec:
owner:
projectName: ecommerce
componentName: frontend-app
workflow:
name: google-cloud-buildpacks
schema:
repository:
url: https://github.com/myorg/frontend-app
revision:
branch: develop
commit: def456
appPath: ./webapp
secretRef: reading-list-repo-credentials-dev
version: 2
testMode: unit
resources:
cpuCores: 2
memoryGb: 4
timeout: "45m"
cache:
enabled: true
paths:
- /root/.cache
- /workspace/node_modules
limits:
maxRetries: 2
maxDurationMinutes: 60
Standalone WorkflowRun (No Component Owner)β
apiVersion: openchoreo.dev/v1alpha1
kind: WorkflowRun
metadata:
name: integration-test-run
namespace: default
spec:
workflow:
name: integration-tests
schema:
repository:
url: https://github.com/myorg/test-suite
branch: main
secretRef: test-repo-credentials
testSuite: smoke
environment: staging
WorkflowRun with Minimal Schemaβ
apiVersion: openchoreo.dev/v1alpha1
kind: WorkflowRun
metadata:
name: simple-build
namespace: default
spec:
owner:
projectName: demo
componentName: hello-world
workflow:
name: docker
schema:
repository:
url: https://github.com/myorg/hello-world
secretRef: github-token
# Uses default values for other fields from Workflow schema
Status Exampleβ
After execution, a WorkflowRun status might look like:
status:
conditions:
- type: Ready
status: "True"
lastTransitionTime: "2024-01-15T10:30:00Z"
reason: WorkflowSucceeded
message: Workflow execution completed successfully
imageStatus:
image: gcr.io/openchoreo-dev/images/my-project-customer-service-image:v1
runReference:
name: customer-service-build-1-abc12
namespace: openchoreo-ci-default
Annotationsβ
WorkflowRuns support the following annotations:
| Annotation | Description |
|---|---|
openchoreo.dev/display-name | Human-readable name for UI display |
openchoreo.dev/description | Detailed description of the workflow run |
Related Resourcesβ
- Workflow - Template definitions for workflow execution
- Component - Components that can trigger WorkflowRuns
- ComponentType - Can restrict allowed workflows