The --env <name> flag targets a named Environment when running a journey. Environments pull in system-level values for the services your journey calls — base URLs, service config, and environment-specific settings. Use --env to point the same journey at sandbox, staging, or production without changing anything else.
When to use it
- Running the same journey against different deployment targets (e.g., staging vs. production).
- CI pipelines where each stage should run against its corresponding environment.
- Any time you want to avoid hardcoding environment-specific values in the journey itself.
Key concepts
Environments describe the system target. An Environment answers “which instance of the system am I talking to?” — it provides base URLs, service endpoints, and environment-level configuration. This is distinct from a Case, which answers “what data am I using for this run?”
Environments are configured in Reqflo. Environments are set up by your team (typically an admin) in the Reqflo Environments settings. The CLI references them by name. See Service environments for setup details.
Environments, cases, and values compose. You can combine --env, --case, and --set in a single command. They each contribute to the run’s value resolution from different sources; they don’t conflict.
Secret references in environments. Environment values can include secret references. In local runs, secrets resolve from your local environment. In cloud runs (--cloud), secrets are resolved by the Cloud Runner using cloud-managed secrets.
How it works
When --env <name> is provided:
- The CLI fetches the named Environment’s value configuration.
- Environment values are loaded into the run’s value resolution context alongside any Case values and
--set overrides.
- The journey runs using the combined, resolved values.
Examples
Run against a staging environment:
reqflo run my-journey --env staging
Run against production:
reqflo run my-journey --env production
Combine environment with a case:
reqflo run my-journey --env staging --case "Happy path"
Combine environment, case, and a value override:
reqflo run my-journey --env staging --case "Happy path" --set timeout_ms=5000
Cloud run against a specific environment:
reqflo run my-journey --env production --cloud
Be intentional when running against production. There is no “dry run” mode — the journey will make real API calls. Use a staging or sandbox environment for routine testing.
Related pages