A workflow is a YAML file that describes the connections between events and tasks of services with a step-by-step system.
It is structured in the following way:
|Name of the workflow|
|Steps to execute (trigger, filter or task)|
A workflow has a list of steps. Each step indicates a specific action to do. There is three types of steps:
An event that will trigger the workflow.
- Should be the first step of the workflow.
- Only one trigger is possible per workflow.
- It triggers the workflow when a matching event is emitted.
Defines the task to execute of a given instance of a service.
- A workflow should have at least one task and can have as many as you want.
- Custom task
Stop the execution of the workflow if a condition doesn't match. Apply one or multiple conditions on the previous step's outputs. All conditions should match to continue to the next step.
- A workflow can have as many filters as you want.
- Filters are optional.
|Key-value map where the key references a data of the previous step's outputs and the value is the expected matching value|
The simplest way to set conditions is to use a
map<string, Value> where the key references a data of the previous step's outputs and the value is the expected matching value.
The condition value can be any of the following types:
- type: filter conditions: previousTaskOutput_1: "hello" # the value of this output must be "hello" previousTaskOutput_2: 10 # the value of this output must be 10 previousTaskOutput_3: true # the value of this output must be true
You can create advanced filters with different predicate and references. Check out the filter documentation.
Here is an example of typical workflow.
name: hello-world steps: - type: trigger endpointKey: helloWorld - type: task handler: ./hello-world.js
You can override any value in the workflow file during the compilation by using the following syntax:
XXXX is the name of the environmental variable defined in your
.env file or given with a flag on the