Skip to main content

ChaosWorkflow

ChaosWorkflow chains multiple experiments into a directed acyclic graph (DAG). Templates execute in dependency order, with independent templates running in parallel.

Group: chaos.chaosplane.io/v1alpha1
Kind: ChaosWorkflow
Scope: Namespaced

Example

apiVersion: chaos.chaosplane.io/v1alpha1
kind: ChaosWorkflow
metadata:
name: resilience-suite
namespace: production
spec:
templates:
- name: kill-pods
type: experiment
experimentRef:
name: pod-kill-experiment
namespace: production

- name: wait
type: delay
delay:
duration: 30s
dependencies: [kill-pods]

- name: network-test
type: experiment
experimentRef:
name: network-delay-experiment
namespace: production
dependencies: [wait]

parameters:
- name: target-namespace
default: production

errorHandling:
strategy: abort

execution:
maxParallelism: 3

Spec fields

spec.templates

List of WorkflowTemplate. Each template is a node in the DAG.

FieldTypeRequiredDescription
namestringYesUnique template name within the workflow
typeTemplateTypeYesexperiment, delay, condition, parallel, or suspend
experimentRefExperimentRefNoReference to a ChaosExperiment (for experiment type)
delayDelaySpecNoDelay configuration (for delay type)
conditionConditionSpecNoCondition configuration (for condition type)
parallelParallelSpecNoParallel configuration (for parallel type)
suspendSuspendSpecNoSuspend configuration (for suspend type)
dependencies[]stringNoNames of templates that must complete before this one starts

Template types

experiment

Runs a ChaosExperiment resource.

- name: my-experiment
type: experiment
experimentRef:
name: pod-kill-test
namespace: production # optional, defaults to workflow namespace

delay

Waits for a fixed duration before proceeding.

- name: recovery-wait
type: delay
delay:
duration: 2m
dependencies: [my-experiment]

condition

Evaluates an expression and branches to different templates.

- name: check-result
type: condition
condition:
expression: "templates.my-experiment.phase == 'Completed'"
ifTrue: success-path
ifFalse: failure-path
dependencies: [my-experiment]
FieldTypeDescription
expressionstringBoolean expression to evaluate
ifTruestringTemplate name to execute if true
ifFalsestringTemplate name to execute if false

parallel

Runs a group of templates concurrently.

- name: parallel-chaos
type: parallel
parallel:
templates: [cpu-stress, memory-stress, network-delay]
FieldTypeDescription
templates[]stringNames of templates to run in parallel

suspend

Pauses the workflow until manually resumed (or timeout elapses).

- name: approval-gate
type: suspend
suspend:
timeout: 1h # optional: auto-resume after this duration
dependencies: [pre-check]
FieldTypeDescription
timeoutDurationOptional auto-resume timeout

spec.parameters

Workflow-level parameters with optional defaults.

FieldTypeDescription
namestringParameter name
defaultstringDefault value
valuestringOverride value

spec.errorHandling

FieldTypeRequiredDefaultDescription
strategyErrorHandlingStrategyNoabortabort, continue, retry, or rollback
StrategyBehavior
abortStop immediately on any template failure
continueKeep running remaining templates
retryRetry the failed template
rollbackAbort and roll back completed experiments

spec.execution

FieldTypeRequiredDefaultDescription
maxParallelismint32NounlimitedMax concurrent template executions

Status fields

FieldTypeDescription
phaseWorkflowPhaseCurrent workflow phase
startTimeTimeWhen the workflow started
endTimeTimeWhen the workflow ended
templateStatuses[]TemplateStatusPer-template status
progressstringHuman-readable progress (e.g. 3/5)
conditions[]ConditionStandard Kubernetes conditions
observedGenerationint64Last reconciled generation

TemplateStatus

FieldTypeDescription
namestringTemplate name
phaseWorkflowPhaseTemplate execution phase
startTimeTimeWhen this template started
endTimeTimeWhen this template ended
messagestringStatus message

Phases

PhaseDescription
PendingCreated, not yet started
RunningAt least one template is executing
PausedSuspended at a suspend template
CompletedAll templates finished successfully
FailedOne or more templates failed
AbortedManually aborted

Printer columns

NAME PHASE PROGRESS AGE
resilience-suite Running 2/5 3m