Flow
- Last updated on December 29, 2023
- •
- 1 minute to read
A pipeline is a linear sequence of steps. Every step represents a single task, which produces and may consume artifacts. The artifacts that tasks share with each other are temporary.
This sequence ends with the finalize
task, which sets the artifacts that will be the pipeline result and removes the temporary artifacts.
Temporary artifacts
The artifacts that the task consumes are specified in inputArtifacts
, and those that it produces and puts into artifact storage are outputArtifacts
.
The first task of every pipeline does not consume artifacts, since it must get files from either the project, asset storage, or another site. The following tasks come first:
extract-project-design
andextract-project-resource
get the project designs or resources.extract-assets
gets an asset from asset storage.download-files
downloads files from the specified URL.
Temporary artifacts exist only until the end of the pipeline.
Final artifacts
The last task in a pipeline is finalize
, in which we specify the resulting artifacts as finalArtifacts
. They will be attached to the project. The remaining artifacts will be considered temporary and removed from the artifact storage.
Skipping tasks by condition
If you want a task to be performed depending on the conditions, you can use the skipIf
and skipIfNot
parameters. For example, you may add a trim
option. If it is set, add cut lines to print files. Otherwise, skip this task.
The syntax of these parameters is:
"skipIf": "<left> = <right>"
"skipIfNot": "<left> = <right>"
The task will be executed if the <left>
and <right>
parts of the condition are equal in skipIf
or not equal in skipIfNot
. Pay attention to the following rules:
- Processing multiple conditions is not supported at the moment.
- If you set both
skipIf
andskipIfNot
, the task will only run if both conditions are met. - Every condition must have a single equal sign (
=
). If not, the task ends with an error. The value is divided into two parts by this sign. - The parts are compared with each other case-insensitive and leading and trailing spaces are truncated.
- The interpolation usually goes in the left part and works according to the standard rules.
For the previous example, you can use these parameters as follows:
{
"tasks": [
...
{
"description": "Apply cut lines",
"type": "combine-with-cut-pattern",
"inputArtifacts": [ ... ],
"parameters": {
"skipIf": "{{project.items.@.fields.trim}} = None",
"cutPatternName": "cut-pattern-1.pdf",
...
},
"outputArtifacts": [ ... ]
},
...
]
}
In the next article, you will learn more details about tasks.