Injected environment variables
Use environment variables
The following environment variables are injected by default in the workflow runs to improve and optimize data management.
| Variable name | Description | Sample value |
|---|---|---|
region | Region of the workflow run | fr-par |
organizationId | ID of the Organization of the workflow | 00000000-0000-0000-0000-000000000000 |
projectId | ID of the Project of the workflow | 00000000-0000-0000-0000-000000000000 |
workflowDefinitionId | ID of the workflow definition | 00000000-0000-0000-0000-000000000000 |
workflowDefinitionName | Name of the workflow definition | "dor-workflow-name" |
workflowVersionId | ID of the workflow version | 00000000-0000-0000-0000-000000000000 |
workflowRunId | ID of the workflow run | 00000000-0000-0000-0000-000000000000 |
triggerType | Type of trigger that launched the workflow run | manual or scheduled |
To reuse these environment variables, use the syntax ${ $workflow.<ENVIRONMENT_VARIABLE> }. In the following examples, replace the placeholders with the appropriate values.
do:
- <TASK_NAME>:
if: ${ $workflow.workflowDefinitionName == "<DOR_WORKFLOW_NAME>" }
call: serverless_job
with:
id: "<SERVERLESS_JOB_ID>"
region: "<REGION>"When a workflow executes a Serverless Job, the environment variables are injected into the job with the following format:
SCW_WOFL_REGIONSCW_WOFL_ORGANIZATION_IDSCW_WOFL_PROJECT_IDSCW_WOFL_DEFINITION_IDSCW_WOFL_DEFINITION_NAMESCW_WOFL_VERSION_IDSCW_WOFL_RUN_IDSCW_WOFL_TRIGGER_TYPE
Environment variables priority
When the same environment variable is injected by multiple sources, the Scaleway infrastructure follows a precedence rule to determine the value for that variable.
The order of precedence, from highest to lowest is the following.
-
Environment variables defined in your command-line environment.
-
Static variables (i.e. variables set in a Terraform/OpenTofu configuration file).
-
Variables defined in the Scaleway SDK configuration file or Scaleway CLI configuration file.