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

The values in the schema below are the default values.
1
# The schema version of this workflow's config (currently not used).
2
apiVersion: garden.io/v0
3
​
4
kind: Workflow
5
​
6
# The name of this workflow.
7
name:
8
​
9
# A description of the workflow.
10
description:
11
​
12
# A map of environment variables to use for the workflow. These will be available to all steps in the workflow.
13
envVars: {}
14
​
15
# A list of files to write before starting the workflow.
16
#
17
# This is useful to e.g. create files required for provider authentication, and can be created from data stored in
18
# secrets or templated strings.
19
#
20
# Note that you cannot reference provider configuration in template strings within this field, since they are resolved
21
# after these files are generated. This means you can reference the files specified here in your provider
22
# configurations.
23
files:
24
- # POSIX-style path to write the file to, relative to the project root (or absolute). If the path contains one
25
# or more directories, they are created automatically if necessary.
26
# If any of those directories conflict with existing file paths, or if the file path conflicts with an existing
27
# directory path, an error will be thrown.
28
# **Any existing file with the same path will be overwritten, so be careful not to accidentally overwrite files
29
# unrelated to your workflow.**
30
path:
31
​
32
# The file data as a string.
33
data:
34
​
35
# The name of a Garden secret to copy the file data from (Garden Enterprise only).
36
secretName:
37
​
38
# The number of hours to keep the workflow pod running after completion.
39
keepAliveHours: 48
40
​
41
resources:
42
requests:
43
# The minimum amount of CPU the workflow needs in order to be scheduled, in millicpus (i.e. 1000 = 1 CPU).
44
cpu:
45
​
46
# The minimum amount of RAM the workflow needs in order to be scheduled, in megabytes (i.e. 1024 = 1 GB).
47
memory:
48
​
49
limits:
50
# The maximum amount of CPU the workflow pod can use, in millicpus (i.e. 1000 = 1 CPU).
51
cpu:
52
​
53
# The maximum amount of RAM the workflow pod can use, in megabytes (i.e. 1024 = 1 GB).
54
memory:
55
​
56
# The maximum amount of CPU the workflow pod can use, in millicpus (i.e. 1000 = 1 CPU).
57
cpu:
58
​
59
# The maximum amount of RAM the workflow pod can use, in megabytes (i.e. 1024 = 1 GB).
60
memory:
61
​
62
# The steps the workflow should run. At least one step is required. Steps are run sequentially. If a step fails,
63
# subsequent steps are skipped.
64
steps:
65
- # An identifier to assign to this step. If none is specified, this defaults to "step-<number of step>", where
66
# <number of step> is the sequential number of the step (first step being number 1).
67
#
68
# This identifier is useful when referencing command outputs in following steps. For example, if you set this
69
# to "my-step", following steps can reference the \${steps.my-step.outputs.*} key in the `script` or `command`
70
# fields.
71
name:
72
​
73
# A Garden command this step should run, followed by any required or optional arguments and flags.
74
# Arguments and options for the commands may be templated, including references to previous steps, but for now
75
# the commands themselves (as listed below) must be hard-coded.
76
#
77
# Supported commands:
78
#
79
# `[build]`
80
# `[delete, environment]`
81
# `[delete, service]`
82
# `[deploy]`
83
# `[exec]`
84
# `[get, config]`
85
# `[get, outputs]`
86
# `[get, status]`
87
# `[get, task-result]`
88
# `[get, test-result]`
89
# `[link, module]`
90
# `[link, source]`
91
# `[publish]`
92
# `[run, task]`
93
# `[run, test]`
94
# `[test]`
95
# `[update-remote, all]`
96
# `[update-remote, modules]`
97
# `[update-remote, sources]`
98
#
99
#
100
command:
101
​
102
# A description of the workflow step.
103
description:
104
​
105
# A map of environment variables to use when running script steps. Ignored for `command` steps.
106
#
107
# Note: Environment variables provided here take precedence over any environment variables configured at the
108
# workflow level.
109
envVars: {}
110
​
111
# A bash script to run. Note that the host running the workflow must have bash installed and on path.
112
# It is considered to have run successfully if it returns an exit code of 0. Any other exit code signals an error,
113
# and the remainder of the workflow is aborted.
114
#
115
# The script may include template strings, including references to previous steps.
116
script:
117
​
118
# Set to true to skip this step. Use this with template conditionals to skip steps for certain environments or
119
# scenarios.
120
skip: false
121
​
122
# If used, this step will be run under the following conditions (may use template strings):
123
#
124
# `onSuccess` (default): This step will be run if all preceding steps succeeded or were skipped.
125
#
126
# `onError`: This step will be run if a preceding step failed, or if its preceding step has `when: onError`.
127
# If the next step has `when: onError`, it will also be run. Otherwise, all subsequent steps are ignored.
128
#
129
# `always`: This step will always be run, regardless of whether any preceding steps have failed.
130
#
131
# `never`: This step will always be ignored.
132
#
133
# See the [workflows guide](https://docs.garden.io/using-garden/workflows#the-skip-and-when-options) for details
134
# and examples.
135
when: onSuccess
136
​
137
# A list of triggers that determine when the workflow should be run, and which environment should be used (Garden
138
# Enterprise only).
139
triggers:
140
- # The environment name (from your project configuration) to use for the workflow when matched by this trigger.
141
environment:
142
​
143
# The namespace to use for the workflow when matched by this trigger. Follows the namespacing setting used for
144
# this trigger's environment, as defined in your project's environment configs.
145
namespace:
146
​
147
# A list of [GitHub events](https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads)
148
# that should trigger this workflow.
149
#
150
# See the Garden Cloud documentation on [configuring
151
# workflows](https://cloud.docs.garden.io/getting-started/workflows) for more details.
152
#
153
# Supported events:
154
#
155
# `pull-request`, `pull-request-closed`, `pull-request-merged`, `pull-request-opened`, `pull-request-reopened`,
156
# `pull-request-updated`, `push`
157
#
158
#
159
events:
160
​
161
# If specified, only run the workflow for branches matching one of these filters. These filters refer to the
162
# pull/merge request's head branch (e.g. `my-feature-branch`), not the base branch that the pull/merge request
163
# would be merged into if approved (e.g. `main`).
164
branches:
165
​
166
# If specified, only run the workflow for pull/merge requests whose base branch matches one of these filters.
167
baseBranches:
168
​
169
# If specified, do not run the workflow for branches matching one of these filters. These filters refer to the
170
# pull/merge request's head branch (e.g. `my-feature-branch`), not the base branch that the pull/merge request
171
# would be merged into if approved (e.g. `main`).
172
ignoreBranches:
173
​
174
# If specified, do not run the workflow for pull/merge requests whose base branch matches one of these filters.
175
ignoreBaseBranches:
Copied!

Configuration Keys

apiVersion

The schema version of this workflow's config (currently not used).
Type
Allowed Values
Default
Required
string
"garden.io/v0"
"garden.io/v0"
Yes

kind

Type
Allowed Values
Default
Required
string
"Workflow"
"Workflow"
Yes

name

The name of this workflow.
Type
Required
string
Yes
Example:
1
name: "my-workflow"
Copied!

description

A description of the workflow.
Type
Required
string
No

envVars

A map of environment variables to use for the workflow. These will be available to all steps in the workflow.
Type
Default
Required
object
{}
No

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.
Type
Default
Required
array[object]
[]
No

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.
Type
Required
posixPath
No
Example:
1
files:
2
- path: ".auth/kubeconfig.yaml"
Copied!

files[].data

​files > data
The file data as a string.
Type
Required
string
No

files[].secretName

​files > secretName
The name of a Garden secret to copy the file data from (Garden Enterprise only).
Type
Required
string
No

keepAliveHours

The number of hours to keep the workflow pod running after completion.
Type
Default
Required
number
48
No

resources

Type
Required
object
No

resources.requests

​resources > requests
Type
Default
Required
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).
Type
Required
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).
Type
Required
number
No

resources.limits

​resources > limits
Type
Default
Required
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).
Type
Required
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).
Type
Required
number
No

limits

Deprecated: This field will be removed in a future release.
Type
Required
object
No

limits.cpu

​limits > cpu
The maximum amount of CPU the workflow pod can use, in millicpus (i.e. 1000 = 1 CPU).
Type
Required
number
No

limits.memory

​limits > memory
The maximum amount of RAM the workflow pod can use, in megabytes (i.e. 1024 = 1 GB).
Type
Required
number
No

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.
Type
Default
Required
array[object]
[]
Yes

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.
Type
Required
string
No

steps[].command[]

​steps > command
A Garden command this step should run, followed by any required or optional arguments and flags. Arguments and options for the commands may be templated, including references to previous steps, but for now the commands themselves (as listed below) must be hard-coded.
Supported commands:
[build] [delete, environment] [delete, service] [deploy] [exec] [get, config] [get, outputs] [get, status] [get, task-result] [get, test-result] [link, module] [link, source] [publish] [run, task] [run, test] [test] [update-remote, all] [update-remote, modules] [update-remote, sources]
Type
Required
array[string]
No
Example:
1
steps:
2
- command:
3
- run
4
- task
5
- my-task
Copied!

steps[].description

​steps > description
A description of the workflow step.
Type
Required
string
No

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.
Type
Default
Required
object
{}
No

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.
Type
Required
string
No

steps[].skip

​steps > skip
Set to true to skip this step. Use this with template conditionals to skip steps for certain environments or scenarios.
Type
Default
Required
boolean
false
No
Example:
1
steps:
2
- skip: "${environment.name != 'prod'}"
Copied!

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.
Type
Default
Required
string
"onSuccess"
No

triggers[]

A list of triggers that determine when the workflow should be run, and which environment should be used (Garden Enterprise only).
Type
Required
array[object]
No

triggers[].environment

​triggers > environment
The environment name (from your project configuration) to use for the workflow when matched by this trigger.
Type
Required
string
Yes

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.
Type
Required
string
No

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
Type
Required
array[string]
No

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).
Type
Required
array[string]
No

triggers[].baseBranches[]

​triggers > baseBranches
If specified, only run the workflow for pull/merge requests whose base branch matches one of these filters.
Type
Required
array[string]
No

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).
Type
Required
array[string]
No

triggers[].ignoreBaseBranches[]

​triggers > ignoreBaseBranches
If specified, do not run the workflow for pull/merge requests whose base branch matches one of these filters.
Type
Required
array[string]
No
Last modified 2mo ago