✏️ Workflow Syntax
The workflow syntax is very simple :
- Yaml
- Json
name: 'Simple case'
description: 'Steps a and b should log their names'
author: 'Selflow Community'
workflow:
timeout: '5m'
steps:
step-a:
kind: 'docker'
with:
image: 'node:lts'
commands: |
echo "##step-a##"
step-b:
kind: 'docker'
with:
image: 'node:lts'
commands: |
echo "##step-b##"
{
"name": "Simple case",
"description": "Steps a and b should log their names",
"author": "Selflow Community",
"workflow": {
"timeout": "5m",
"steps": {
"step-a": {
"kind": "docker",
"with": {
"image": "node:lts",
"commands": "echo \"##step-a##\"\n"
}
},
"step-b": {
"kind": "docker",
"with": {
"image": "node:lts",
"commands": "echo \"##step-b##\"\n"
}
}
}
}
}
Metadata
First, the workflow starts with the metadata attributes :
name: 'Simple case'
description: 'Steps a and b should log their names'
author: 'Selflow Community'
These fields are ignore by Selflow, you can use them if you want to specify things about your workflow like why you are using them.
In the future, the idea is to be able to access these fields in the steps definitions and to be able to put names on workflow executions.
The workflow definition
workflow:
timeout: '5m'
steps:
step-a:
kind: 'docker'
with:
image: 'node:lts'
commands: |
echo "##step-a##"
step-b:
kind: 'docker'
with:
image: 'node:lts'
commands: |
echo "##step-b##"
This part contains all the workflow definition.
First, the timeout
attribute specifies the maximum duration of the workflow, it is required.
Then, the steps
attributes contains a map of all steps.
You can have more details about this part in the step documentation