Skip to main content

Hello World

A minimal workflow that sets a single value and returns it.

What you will learn

  • How to structure the document header required by every workflow
  • How the set task stores values in workflow state
  • How output.as shapes 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

PartPurpose
document.namespaceSets the Temporal task queue to zigflow
document.nameSets the workflow type to hello-world
setWrites message into the workflow state
output.asShapes 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

  1. Start a Temporal development server:

    temporal server start-dev
  2. Start the worker:

    zigflow run -f workflow.yaml
  3. Trigger the workflow:

    temporal workflow start \
    --type hello-world \
    --task-queue zigflow \
    --workflow-id hello-1
  4. 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.