Hello World
This example creates a two-step workflow that greets someone and then shouts the greeting in uppercase.
Workflow file
Section titled “Workflow file”Create workspace/.workflows/hello.yaml:
actions: greet: type: script script: "echo Hello {{ input.name }} && echo 'OUTPUT: {\"greeting\": \"Hello {{ input.name }}\"}'" input: name: { type: string, required: true }
shout: type: script script: "echo {{ input.message }} | tr '[:lower:]' '[:upper:]'" input: message: { type: string, required: true }
tasks: hello-world: mode: distributed input: name: { type: string, default: "World" } flow: say-hello: action: greet input: name: "{{ input.name }}" shout-it: action: shout depends_on: [say-hello] input: message: "{{ say_hello.output.greeting }}"What this does
Section titled “What this does”greetaction prints “Hello World” and emits structured output withOUTPUT: {json}shoutaction takes a message and converts it to uppercasehello-worldtask runssay-hellofirst, then passes its output toshout-it
The two steps form a dependency chain: say-hello → shout-it.
Key concepts demonstrated
Section titled “Key concepts demonstrated”- Actions define reusable commands with typed input parameters
- Tasks compose actions into a DAG via
depends_on - Structured output uses
OUTPUT: {json}prefix in stdout - Data passing uses Tera templates:
{{ say_hello.output.greeting }} - Step name sanitization:
say-hellobecomessay_helloin templates (hyphens → underscores)
Running it
Section titled “Running it”# Via APIcurl -s -X POST http://localhost:8080/api/workspaces/default/tasks/hello-world/execute \ -H "Content-Type: application/json" \ -d '{"input": {"name": "World"}}' | jq .
# Via CLIstroem trigger hello-world --input '{"name": "World"}'Expected output
Section titled “Expected output”Step say-hello:
Hello WorldOUTPUT: {"greeting": "Hello World"}Step shout-it:
HELLO WORLD