Simple HTTP Call
The most basic workflow: making a single HTTP request.do-single.yaml
- Minimal workflow structure with
documentmetadata - Single task execution using
call: http - Path parameter interpolation with
{petId}from workflow input - Shorthand endpoint notation (string instead of object)
Sequential Task Execution
Executing multiple tasks in sequence, passing data between them.do-multiple.yaml
- Multiple tasks executed in order
- Data flows automatically from one task to the next
- Expression language (
${ }) for data transformation - Merging current data with new properties using object spread (
. + { })
Data Manipulation with Set
- Basic Set
- Complex Set
set.yaml
- Setting workflow variables with
settask - Accessing workflow input via
$workflow.input - Capturing the triggering event for later use
Conditional Execution
Executing tasks based on runtime conditions.conditional-task.yaml
- Conditional task execution with
ifclause - Early termination using
then: end - Preventing subsequent tasks from running when condition is met
- Inline error raising for validation
Iteration with For Loop
Processing collections of items.for.yaml
- Iterating over collections with
for - Naming the iteration variable (
each: pet) - Accessing the loop index (
at: index) - Conditional looping with
while - Nested tasks within the loop body
- Building up results with output transformation
Parallel Execution with Fork
Executing multiple tasks concurrently.fork.yaml
- Parallel task execution with
fork - Competitive completion mode (
compete: true) - first to complete wins - Multiple branches running simultaneously
- Shared data access across branches
Workflow Composition
Calling subworkflows for modularity and reuse.run-subflow.yaml
- Invoking child workflows with
run: workflow - Fully qualified workflow reference (namespace, name, version)
- Passing data to subworkflows via
input - Data transformation when calling subworkflows (
.usermapped tocustomer)
Container Execution
Running containerized workloads within workflows.- Basic Container
- With Arguments
- Shell Execution
run-container.yaml
- Running containers with
run: container - Executing shell commands with
run: shell - Passing data via stdin
- Providing command-line arguments
- Capturing container/shell output
Summary
These basic patterns form the foundation of serverless workflows:- Tasks - The atomic units of work (HTTP calls, data operations, etc.)
- Sequencing - Tasks execute in order by default
- Conditionals - Use
ifto execute tasks selectively - Iteration - Process collections with
forloops - Parallelism - Use
forkfor concurrent execution - Composition - Build complex workflows from simpler ones
- Containers - Integrate containerized workloads