Hello, Playbook
REAL
A playbook is a YAML file. This is the smallest valid one: the four required keys, and a workflow with one step.
# Chapter 1.2: the smallest valid playbook. Four required keys, one step.
apiVersion: noetl.io/v2
kind: Playbook
metadata:
name: minimal
workflow:
- step: start
tool:
kind: rhai
code: |
"hello, playbook"
apiVersion: noetl.io/v2andkind: Playbooksay what the document is. They are the only accepted values.metadata.namenames it.workflowis the list of steps. Each step has a name (step) and atool. Here the tool isrhai, a small embedded scripting language, and the step's result is the value of its last expression.- The first step is called
start. A NoETL server always begins an execution atstart, so name your first step that.
Chapter 4 covers every key.
Adding an input and a second step
# Chapter 1.2: hello, with an input. The first step runs a shell command (local
# runtime field `cmds:`), the second a Rhai expression.
apiVersion: noetl.io/v2
kind: Playbook
metadata:
name: hello
workload:
who: world
workflow:
- step: start
tool:
kind: shell
cmds:
- echo "hello {{ workload.who }}"
next:
- step: done
- step: done
tool:
kind: rhai
code: |
40 + 2
workloadholds the playbook's inputs, with defaults. A template reads them:{{ workload.who }}.nextsends control fromstarttodonewhenstartfinishes.- The first step runs a shell command. Locally the commands go
under
cmds:. On a cluster the shell tool's field iscommand:instead (5.1). This example is for the local runtime.