xFlow
  • Overview
    • Introduction
    • Core Features
    • Architecture
      • High Level Architecture
      • Tech Stack
      • Deployment Flexibility
      • Performance and Scalability
      • Security Compliance
  • Getting Started
    • Installation
    • Quick Start
    • Configuration
  • Core Concepts
    • Serverless Workflow Specification
    • Workflow data handling
    • Workflow Expressions
    • Error handling
    • Input and Output schema definition
    • User Task
    • User Forms
      • Lowcode Form
      • Advanced User Form
    • AI Agents in Enterprise Business Processes
    • Comparisons
      • BPMN2
  • Developer Guide
    • Architecture
    • API Reference
    • Workflow States Reference
      • Event State
      • Operation State
      • Switch State
      • Parallel State
      • Inject State
      • ForEach State
      • Callback State
      • UserTask State
      • AIAgent State
      • AIAgentProxy State
      • UserProxyAgent State
      • AI Outbound Agent State
    • Workflow Functions
      • REST
      • GraphQL
      • Custom
        • Built-in Functions
        • Lowcoder Query Function
      • Function Auth
    • Workflow Secrets
    • Environment Variables
    • Integrations
    • Workflow Modeler
    • Frontend Development
      • Forms
        • Lowcode Form
        • Advanced User Form
    • Serverless Workflow Development
      • Operation State
      • Switch State
      • Parallel State
      • ForEach State
      • Callback State
      • User Task State
    • AI Agent Development
      • AI Agent
        • Predefined LLM
        • LLM Configuration
        • Multi LLM Configuration
        • Chat Memory
        • Tools
        • Data Output
        • Agent Outcomes
      • AI Agent Proxy
        • AI Agents Integration
      • User Proxy Agent
      • xChatBot Integration
  • Examples
    • Basic Examples
    • Advanced Examples
      • Loan Approval Workflow
      • QMS AP Workflow
  • Administration
    • Monitoring and Logging
    • Security
    • Performance Tuning
  • Extensions and Customizations
    • Plugins and Add-ons
  • Troubleshooting
    • Common Issues
    • FAQs
  • Release Notes
    • Version History
    • Upcoming Features
  • Support
    • Contact Information
    • Community
Powered by GitBook
On this page
  • Declaring environment variables
  • Using environment variables in expressions
  • Behaviour and guarantees
  1. Developer Guide

Environment Variables

Environment variables let you pass non-sensitive configuration values—such as region codes, feature flags, or default bucket names—into Workflow expressions. They are declared once, at the top level of the Workflow definition, with the envs property and are referenced inside the Workflow with the predefined $ENVS object.

Declaring environment variables

{
  "id": "image-pipeline",
  "envs": ["DEFAULT_REGION", "PUBLIC_BUCKET", "FEATURE_FLAG"],
  ...
}
  • Add every required variable to the envs array.

  • At runtime, the engine is responsible for supplying the actual values (for example via process env, a .env file, or an orchestration secret store).

Using environment variables in expressions

Inside any expression—task arguments, branch conditions, timeouts, etc.—reference a variable through $ENVS.<NAME>:

{
  "refName": "upload-public-asset",
  "arguments": {
    "bucket":     "${ $ENVS.PUBLIC_BUCKET }",
    "region":     "${ $ENVS.DEFAULT_REGION }",
    "visibility": "public"
  }
}

$ENVS is available everywhere expressions are evaluated, so you can also combine it with expression functions:

"filePath": "${ concat('/assets/', $ENVS.FEATURE_FLAG, '/', input.fileName) }"

Behaviour and guarantees

Property
Details

Immutability

Values are read-only inside the workflow—expressions may consume but not modify them.

Scope

Accessible from any expression in any state of the workflow.

Type

All values are injected as strings; cast or parse as needed in your expressions.

Validation

If the runtime cannot supply a value for every listed variable, it MUST fail the workflow start-up.

Tip: Use envs for regular configuration and reserve secrets for credentials and other sensitive data.

PreviousWorkflow SecretsNextIntegrations

Last updated 12 days ago