gcloud workflows deploy Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud workflows deploy - create or update a workflow
- SYNOPSIS
gcloud workflows deploy(WORKFLOW:--location=LOCATION)[--async][--call-log-level=CALL_LOG_LEVEL; default="none"][--description=DESCRIPTION][--execution-history-level=EXECUTION_HISTORY_LEVEL; default="none"][--labels=[KEY=VALUE,…]][--service-account=SERVICE_ACCOUNT][--source=SOURCE][--tags=[KEY=VALUE,…]][--clear-env-vars|--env-vars-file=FILE_PATH|--remove-env-vars=[KEY,…] |--set-env-vars=[KEY=VALUE,…] |--update-env-vars=[KEY=VALUE,…]][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
- Create or update a workflow.
- EXAMPLES
- To deploy a workflow with source code myWorkflow.yaml on Workflows:
gcloudworkflowsdeploymy-workflow--source=myWorkflow.yamlYou may also skip waiting for the operation to finish:
gcloudworkflowsdeploymy-workflow--source=myWorkflow.yaml--asyncTo specify a service account as the workflow identity:
gcloudworkflowsdeploymy-workflow--source=myWorkflow.yaml--service-account=my-account@my-project.iam.gserviceaccount.com - POSITIONAL ARGUMENTS
- Workflow resource - Name of the workflow to deploy. The arguments in this groupcan be used to specify the attributes of this resource. (NOTE) Some attributesare not given arguments in this group but can be set in other ways.
To set the
projectattribute:- provide the argument
workflowon the command line with a fullyspecified name; - provide the argument
--projecton the command line; - set the property
core/project.
This must be specified.
WORKFLOW- ID of the workflow or fully qualified identifier for the workflow.
To set the
workflowattribute:- provide the argument
workflowon the command line.
This positional argument must be specified if any of the other arguments in thisgroup are specified.
- provide the argument
--location=LOCATION- Cloud location for the workflow. Alternatively, set the property[workflows/location].
To set the
locationattribute:- provide the argument
workflowon the command line with a fullyspecified name; - provide the argument
--locationon the command line; - set the property
workflows/location.
- provide the argument
- provide the argument
- Workflow resource - Name of the workflow to deploy. The arguments in this groupcan be used to specify the attributes of this resource. (NOTE) Some attributesare not given arguments in this group but can be set in other ways.
- FLAGS
--async- Return immediately, without waiting for the operation in progress to complete.
--call-log-level=CALL_LOG_LEVEL; default="none"- Level of call logging to apply by default for the workflow.
CALL_LOG_LEVELmust be one of:log-all-calls- Log all calls to subworkflows or library functions and their results.
log-errors-only- Log when a call is stopped due to an exception.
log-none- Perform no call logging.
none- No logging level specified.
--description=DESCRIPTION- The description of the workflow to deploy.
--execution-history-level=EXECUTION_HISTORY_LEVEL; default="none"- Level of execution history to apply for the workflow.
EXECUTION_HISTORY_LEVELmust be one of:execution-history-basic- Enable basic execution history.
execution-history-detailed- Enable detailed execution history, including expected iterations and in-scopevariable values.
none- No execution history level specified.
--labels=[KEY=VALUE,…]- List of label KEY=VALUE pairs to add.
Keys must start with a lowercase character and contain only hyphens(
-), underscores (_), lowercase characters, andnumbers. Values must contain only hyphens (-), underscores(_), lowercase characters, and numbers. --service-account=SERVICE_ACCOUNT- The service account that should be used as the workflow identity."projects/PROJECT_ID/serviceAccounts/" prefix may be skipped from the fullresource name, in that case "projects/-/serviceAccounts/" is prepended to theservice account ID.
--source=SOURCE- Location of a workflow source code to deploy. Required on first deployment.Location needs to be defined as a path to a local file with the source code.
--tags=[KEY=VALUE,…]- List of tags KEY=VALUE pairs to bind. Each item must be expressed as"<tag-key-namespaced-name>=<tag-value-short-name>".
Example: 123/environment=production,123/costCenter=marketing
- Flags to configure user-defined environment variables for a workflow.
Keyscan't be empty strings and can'tstartwith`GOOGLE`or`WORKFLOWS`.Werecommendthatenvironmentvariablekeysconsistsolelyofuppercaseletters,digits,andunderscores(`_`),andthattheydon'tbeginwithadigit.Considerprefixingyouruser-definedenvironmentvariableswithauniquekeytoavoidconflictswithothervariables.
Ifyourvaluecontainscommas,prefixthemappingwithadifferentdelimitercharacterenclosedbetween`^`(example1).Usespecialcharactersinyourshellwithcautionastheymightnotworkasintendedorneedescaping(example2escapesa`$`inBash).
Example1:--set-env-vars^@^KEY1=ONE,VALUE,WITH,COMMAS@KEY2=VALUE2
Example2:--set-env-vars^$^KEY1=VALUE1\$KEY2=VALUE,WITH,COMMAS,TOO
At most one of these can be specified:Amaximumof20user-definedenvironmentvariablescanbedefined.Eachdefinitionstring(`KEY=value`)islimitedto4KiB.Allkeysandvaluesareconvertedtostrings.
--clear-env-vars- Clears all user-defined environment variables previously set for the workflow.
Example: gcloud workflows deploy ${workflow_name} --clear-env-vars
--env-vars-file=FILE_PATH- Sets environment variables for the workflow to those stored in a local YAML fileat the given path. All existing environment variables are removed before the newenvironment variables are added.
Example: gcloud workflows deploy ${workflow_name}--env-vars-file=/path/to/env_vars.yaml
Inside env_vars.yaml:
policy: global
retry_count: 5 # Service converts this to string "5"
--remove-env-vars=[KEY,…]- Removes user-defined environment variables from a workflow based on a list ofenvironment variable keys to be removed.
Example: gcloud workflows deploy ${workflow_name} --remove-env-varspolicy,retry_count…
--set-env-vars=[KEY=VALUE,…]- Sets environment variables for the workflow based on a comma-separated list ofkey-value pairs. Will overwrite a workflow's existing environment variables.
Example: gcloud workflows deploy ${workflow_name} --set-env-varspolicy=global,retry_count=5
--update-env-vars=[KEY=VALUE,…]- Updates existing or adds new user-defined environment variables based on acomma-separated list of key-value pairs.
Example: gcloud workflows deploy ${workflow_name} --update-env-varspolicy=regional,retry_count=2
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$gcloud helpfor details. - NOTES
- This variant is also available:
gcloudbetaworkflowsdeploy
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-22 UTC.