Built-in environment variables

Workflows supports built-in environment variables that enable access to a workflow's environment information. Built-in environment variables require no declaration and are available in every workflow execution.

User-defined environment variables are not supported.

List of built-in environment variables

The following built-in environment variables are available:

  • GOOGLE_CLOUD_PROJECT_NUMBER: The workflow project's number.
  • GOOGLE_CLOUD_PROJECT_ID: The workflow project's identifier.
  • GOOGLE_CLOUD_LOCATION: The workflow's location.
  • GOOGLE_CLOUD_WORKFLOW_ID: The workflow's identifier.
  • GOOGLE_CLOUD_WORKFLOW_REVISION_ID: The workflow's revision identifier.

Accessing built-in environment variables

To access an environment variable, make a call to sys.get_env() function in an expression, passing the name of the environment variable as a parameter. The name of the environment variable must be passed as a string.

For example, the following step assigns the value of the environment variable GOOGLE_CLOUD_PROJECT_ID to a workflow variable called projectID:

- getProjectID:
      - projectID: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")}