Workflow Configuration
Below is the schema reference for Workflow configuration files. For an introduction to configuring a Garden project, please look at our configuration guide.
The reference is divided into two sections:
YAML Schema contains the config YAML schema
Configuration keys describes each individual schema key for the configuration files.
YAML Schema
The values in the schema below are the default values.
Configuration Keys
kind
kind
string
"Workflow"
"Workflow"
Yes
name
name
The name of this workflow.
string
Yes
Example:
description
description
A description of the workflow.
string
No
envVars
envVars
A map of environment variables to use for the workflow. These will be available to all steps in the workflow.
object
{}
No
files[]
files[]
A list of files to write before starting the workflow.
This is useful to e.g. create files required for provider authentication, and can be created from data stored in secrets or templated strings.
Note that you cannot reference provider configuration in template strings within this field, since they are resolved after these files are generated. This means you can reference the files specified here in your provider configurations.
array[object]
[]
No
files[].path
files[].path
files > path
POSIX-style path to write the file to, relative to the project root (or absolute). If the path contains one or more directories, they are created automatically if necessary. If any of those directories conflict with existing file paths, or if the file path conflicts with an existing directory path, an error will be thrown. Any existing file with the same path will be overwritten, so be careful not to accidentally overwrite files unrelated to your workflow.
posixPath
No
Example:
files[].data
files[].data
files > data
The file data as a string.
string
No
files[].secretName
files[].secretName
files > secretName
The name of a Garden secret to copy the file data from (Garden Cloud only).
string
No
keepAliveHours
keepAliveHours
The number of hours to keep the workflow pod running after completion.
number
48
No
resources
resources
object
No
resources.requests
resources.requests
resources > requests
object
{"cpu":50,"memory":64}
No
resources.requests.cpu
resources.requests.cpu
The minimum amount of CPU the workflow needs in order to be scheduled, in millicpus (i.e. 1000 = 1 CPU).
number
No
resources.requests.memory
resources.requests.memory
The minimum amount of RAM the workflow needs in order to be scheduled, in megabytes (i.e. 1024 = 1 GB).
number
No
resources.limits
resources.limits
resources > limits
object
{"cpu":1000,"memory":1024}
No
resources.limits.cpu
resources.limits.cpu
The maximum amount of CPU the workflow pod can use, in millicpus (i.e. 1000 = 1 CPU).
number
No
resources.limits.memory
resources.limits.memory
The maximum amount of RAM the workflow pod can use, in megabytes (i.e. 1024 = 1 GB).
number
No
limits
limits
Deprecated: This field will be removed in a future release.
object
No
limits.cpu
limits.cpu
limits > cpu
The maximum amount of CPU the workflow pod can use, in millicpus (i.e. 1000 = 1 CPU).
number
No
limits.memory
limits.memory
limits > memory
The maximum amount of RAM the workflow pod can use, in megabytes (i.e. 1024 = 1 GB).
number
No
steps[]
steps[]
The steps the workflow should run. At least one step is required. Steps are run sequentially. If a step fails, subsequent steps are skipped.
array[object]
[]
Yes
steps[].name
steps[].name
steps > name
An identifier to assign to this step. If none is specified, this defaults to "step-", where is the sequential number of the step (first step being number 1).
This identifier is useful when referencing command outputs in following steps. For example, if you set this to "my-step", following steps can reference the ${steps.my-step.outputs.*} key in the script
or command
fields.
string
No
steps[].command[]
steps[].command[]
steps > command
A Garden command this step should run, followed by any required or optional arguments and flags.
Note that commands that are persistentβe.g. the dev command, commands with a watch flag set, the logs command with following enabled etc.βare not supported. In general, workflow steps should run to completion.
Global options like --env, --log-level etc. are currently not supported for built-in commands, since they are handled before the individual steps are run.
array[string]
No
Example:
steps[].description
steps[].description
steps > description
A description of the workflow step.
string
No
steps[].envVars
steps[].envVars
steps > envVars
A map of environment variables to use when running script steps. Ignored for command
steps.
Note: Environment variables provided here take precedence over any environment variables configured at the workflow level.
object
{}
No
steps[].script
steps[].script
steps > script
A bash script to run. Note that the host running the workflow must have bash installed and on path. It is considered to have run successfully if it returns an exit code of 0. Any other exit code signals an error, and the remainder of the workflow is aborted.
The script may include template strings, including references to previous steps.
string
No
steps[].skip
steps[].skip
steps > skip
Set to true to skip this step. Use this with template conditionals to skip steps for certain environments or scenarios.
boolean
false
No
Example:
steps[].when
steps[].when
steps > when
If used, this step will be run under the following conditions (may use template strings):
onSuccess
(default): This step will be run if all preceding steps succeeded or were skipped.
onError
: This step will be run if a preceding step failed, or if its preceding step has when: onError
. If the next step has when: onError
, it will also be run. Otherwise, all subsequent steps are ignored.
always
: This step will always be run, regardless of whether any preceding steps have failed.
never
: This step will always be ignored.
See the workflows guide for details and examples.
string
"onSuccess"
No
steps[].continueOnError
steps[].continueOnError
steps > continueOnError
Set to true to continue if the step errors.
boolean
false
No
triggers[]
triggers[]
A list of triggers that determine when the workflow should be run, and which environment should be used (Garden Cloud only).
array[object]
No
triggers[].environment
triggers[].environment
triggers > environment
The environment name (from your project configuration) to use for the workflow when matched by this trigger.
string
Yes
triggers[].namespace
triggers[].namespace
triggers > namespace
The namespace to use for the workflow when matched by this trigger. Follows the namespacing setting used for this trigger's environment, as defined in your project's environment configs.
string
No
triggers[].events[]
triggers[].events[]
triggers > events
A list of GitHub events that should trigger this workflow.
See the Garden Cloud documentation on configuring workflows for more details.
Supported events:
pull-request
, pull-request-closed
, pull-request-merged
, pull-request-opened
, pull-request-reopened
, pull-request-updated
, push
array[string]
No
triggers[].branches[]
triggers[].branches[]
triggers > branches
If specified, only run the workflow for branches matching one of these filters. These filters refer to the pull/merge request's head branch (e.g. my-feature-branch
), not the base branch that the pull/merge request would be merged into if approved (e.g. main
).
array[string]
No
triggers[].baseBranches[]
triggers[].baseBranches[]
triggers > baseBranches
If specified, only run the workflow for pull/merge requests whose base branch matches one of these filters.
array[string]
No
triggers[].ignoreBranches[]
triggers[].ignoreBranches[]
triggers > ignoreBranches
If specified, do not run the workflow for branches matching one of these filters. These filters refer to the pull/merge request's head branch (e.g. my-feature-branch
), not the base branch that the pull/merge request would be merged into if approved (e.g. main
).
array[string]
No
triggers[].ignoreBaseBranches[]
triggers[].ignoreBaseBranches[]
triggers > ignoreBaseBranches
If specified, do not run the workflow for pull/merge requests whose base branch matches one of these filters.
array[string]
No
Last updated