Workflows
What is a Workflow?
env0 Workflows provide a structured approach to managing groups of related environments by defining their dependencies and orchestrating the entire process. env0 ensures that all dependencies are satisfied and the Workflow runs smoothly from start to finish.
This is especially useful for managing systems divided into multiple subsystems, allowing you to oversee the entire system as a cohesive unit while retaining control over individual stacks. It also simplifies the process of breaking down IaC stacks into smaller, more manageable parts.
Workflows are defined declaratively through a Workflow configuration YAML file and are designed to be reused as templates. The environments within a Workflow are also based on these reusable templates, promoting consistency and efficiency.
When Should You Use Workflows?
The infrastructure of a production app consists of many different resources. The more resources there are, the more thought and effort is required to manage and deploy them.
We tend to view managing resources as we do code â split them into smaller manageable pieces (Environments) where each piece is cohesive and loosely coupled.
In theory, this textbook solution sounds great because each Environment is independent and can be deployed at any time. The thing is, in the real world we have dependencies, and deploying all these Environments simultaneously is impractical.
Basic Dependency Example
Environment Network and VPC manages all necessary network configurations.
Environment DB manages a database that multiple services use.
Environment EKS manages the Elastic Kubernetes Service onto which pods of services will be deployed.Environments Billing Service, Configuration Service, and Notification Service all manage the deployments of services on EKS. These services need access to the database.
For this use case:
Environment DB depends on the VPC from the Network and VPC IaC stack.
Environment EKS also depends on the VPC from the Network and VPC IaC stack.
All service environments depend on DB, and EKS.As you can see, these dependencies make it impossible for all the Environments to be deployed simultaneously â not to mention that as the resources and Environments grow, the complexity of the dependencies will increase.
Workflows will help you manage and deploy your environments with their dependencies.
Workflow Environment Status
A Workflow Environment can be in one of the following states:
Active - All sub-environments have been successfully deployed and are up and running.
Inactive - All sub-environments have been successfully destroyed, manually or automatically.
Deploy in progress - Currently being deployed.
Destroy in progress- Currently being destroyed.
Failed - Errors were encountered during deployment in at least 1 sub-environment
Workflow Benefits
- Manage your entire infrastructure with complex dependencies between Environments.
- Visual presentation of the complex deployment.
- Each Environment can use a different IaC tool â one Environment can be managed by Terraform while another is managed by K8S.
- Enhanced experience from all surrounding env0 features such as Policies, Custom flows, Drift Detection and Continuous Deployment.
Environment Variables
If you'd like to pass Environment Variables to all IaC stacks in the workflow.
To do that, simply add/edit Environment variables when deploying the workflow.
If you'd like to set some specific Environment variable for a specific Environment in the workflow, you'd have to redeploy that specific Environment and add/edit that Environment variable
Updated 6 months ago