A workflow is used to perform a series of specific "steps" to complete specific tasks, such as installation, updating, or uninstallation.
An example installation workflow might look like this:
Semantically, it can be roughly seen that this workflow performs the following two steps:
Code.exe
, with the shortcut name Visual Studio Code
Code.exe
to the environment variablesWe will explain the composition of the workflow in detail below.
A workflow is composed of several steps, for example:
is an independent step, which is used to copy a folder.
Each step is an independent toml table and must include the step
field to indicate what kind of operation the step needs to perform; the value of the step
field must be one of the several step types defined in Definitions and APIs.
Below the step
field are the unique fields of the Copy
step—from
and to
, indicating where to copy files from and where to copy them to. For different steps, you can view Definitions and APIs to understand their respective unique fields.
The key of the step usually uses snake_case to indicate the actual meaning of the operation the step wants to perform, for example, the example above indicates that this step wants to copy the configuration folder. Since keys cannot contain spaces, special characters, or Chinese characters, if you want to express the meaning of the operation more clearly, you can add a name
field to the step: