# env

The `env` step type stores environment variables for the steps that follow, letting one step in a custom command or workflow compute values that later steps consume. Values always become available as `{{ .env.NAME }}`. By default they also reach later child processes.

```yaml
steps:
  - name: set_region
    type: env
    vars:
      AWS_REGION: us-east-2

  - type: shell
    command: echo "$AWS_REGION"
```

## Fields

- **`vars`**
  Required. Map of environment variable names to values. Values support templates.
- **`export`**
  Optional, defaults to 
  true
  . When 
  false
  , values remain available through 
  \{{ .env.NAME }}
   but are not added to later child-process environments.

This step type is different from the step-level [`env`](/workflows/steps/env) field, which applies environment variables only to the current step.

Values set by an `env` step override workflow-level `env` values for later
steps. A later step's own `env` field still takes precedence for that step.

Use `export: false` when a value is only needed to render later step fields:

```yaml
steps:
  - type: env
    export: false
    vars:
      release_name: api-prod

  - type: shell
    command: echo "Deploying {{ .env.release_name }}"
```

The shell process above does not receive `release_name` as an environment variable.
