Workflows
Configure where Atmos looks for workflow definition files. Workflows allow you to automate sequences of Atmos commands and other operations.
Configuration
Workflows are configured in the workflows section:
atmos.yaml
Configuration Options
workflows.base_pathBase path to Atmos workflow definition files. Supports both absolute and relative paths. When
base_pathis set in the root configuration, this path is relative to it. Can also be set usingATMOS_WORKFLOWS_BASE_PATHenvironment variable or--workflows-dircommand-line argument.
Directory Structure
A typical workflows directory structure:
stacks/workflows/
├── deploy.yaml
├── destroy.yaml
├── validate.yaml
└── maintenance/
├── backup.yaml
└── rotate-credentials.yaml
Example Workflow File
stacks/workflows/deploy.yaml
Working Directory
Workflows support a working_directory setting that controls where steps execute. This can be set at both the workflow level (applies to all steps) and individual step level (overrides workflow setting).
Path Resolution
- Absolute paths are used as-is (e.g.,
/tmp) - Relative paths are resolved against the Atmos
base_path - The
!repo-rootYAML function can dynamically resolve to the git repository root
Example: Workflow-Level Working Directory
stacks/workflows/build.yaml
All steps inherit the workflow's working_directory setting.
Example: Step-Level Override
stacks/workflows/download.yaml
The first step overrides the workflow setting to run in /tmp, while subsequent steps use the workflow-level working_directory (repo root).
Example: Mixed Atmos and Shell Commands
stacks/workflows/mixed.yaml
Use working_directory when your workflow includes shell commands that depend on relative file paths, or when you need to run commands like terraform import directly in a component directory.
Workflow Environment Variables
Workflows support an env map for setting environment variables. This can be set at both workflow level (applies to all steps) and step level (overrides workflow values).
workflows:
deploy-multi-region:
env:
TF_LOG: INFO
steps:
- command: terraform apply vpc -s plat-ue2-dev --auto-approve
env:
AWS_REGION: us-east-2
- command: terraform apply vpc -s plat-uw2-dev --auto-approve
env:
AWS_REGION: us-west-2
Precedence
Environment variables merge in this order (later values win):
- System environment
- Global env from
atmos.yaml - Workflow-level
env - Step-level
env - Auth identity environment (if
identityspecified)
Scoping
Each step runs as a separate subprocess. Step-level env and shell export commands only affect that step and do not persist to subsequent steps.
CLI Environment Variables
ATMOS_WORKFLOWS_BASE_PATH- Base path to Atmos workflow definitions.
Related Commands
📄️ atmos workflow
Execute Atmos workflows
📄️ atmos list workflows
List available workflows
See Also
- CLI Configuration — Overview of CLI configuration
- Workflows — Complete guide to Atmos workflows