Hello World
A minimal workflow that sets a single value and returns it.
What you will learn
- How to structure the
documentheader required by every workflow - How the
settask stores values in workflow state - How
output.asshapes the workflow result
Workflow
workflow.yaml
document:
dsl: 1.0.0
namespace: zigflow
name: hello-world
version: 0.0.1
do:
- greet:
set:
message: Hello from Ziggy
output:
as:
data: ${ . }
Explanation
| Part | Purpose |
|---|---|
document.namespace | Sets the Temporal task queue to zigflow |
document.name | Sets the workflow type to hello-world |
set | Writes message into the workflow state |
output.as | Shapes the return value of this task |
The set task runs as a
Temporal side effect,
so generated values such as ${ uuid } are determinism-safe here.
How to run
-
Start a Temporal development server:
temporal server start-dev -
Start the worker:
zigflow run -f workflow.yaml -
Trigger the workflow:
temporal workflow start \
--type hello-world \
--task-queue zigflow \
--workflow-id hello-1 -
View the result:
temporal workflow show --workflow-id hello-1
Expected output
{
"data": {
"message": "Hello from Ziggy"
}
}
Common mistakes
"No workers are registered for this task queue."
The --task-queue value must match document.namespace in the YAML
file.
"Workflow type not found."
The --type value must match document.name in the YAML file.
Related pages
- Set — the task used here
- Quickstart — guided walkthrough
- HTTP Call — next example