# Environment Configuration

In real‑world enterprise applications, **Microflows and integration logic** often interact with databases and external services.\
However, configuration values such as database URLs, JNDI names, or service endpoints typically **differ across environments**, for example:

* Development (DEV)
* Testing (SIT / UAT)
* Production (PROD)

Starting from **ONEWEB version 4.0.0.19**, the platform provides **Environment Configuration**, allowing such values to be defined as **environment variables**.\
These variables can then be referenced directly in **Microflow** or **Process** configurations.

This approach enables smooth deployment across environments **without modifying Microflow logic or diagrams**.

***

### Benefits of Environment Configuration

Using environment variables provides several important advantages:

* Avoids hard‑coding environment‑specific values
* Enables the same Microflow to run safely across multiple environments
* Reduces configuration errors during deployment
* Improves maintainability and governance
* Supports enterprise CI/CD and promotion practices

Environment Configuration ensures that Microflows remain **portable, reusable, and production‑ready**.

***

### Environment Setup and Variable Definition

Environment Configuration is managed at the **application level** and consists of the following conceptual elements.

#### Environment Definition

Applications may define multiple environments, such as:

* DEV
* TEST
* UAT
* PROD

Each environment represents a **deployment context** with its own configuration values.

<figure><img src="/files/NSmYdWLETTsZKrwgvgOw" alt=""><figcaption></figcaption></figure>

***

#### Profiles (Optional)

Within an environment, **profiles** can be created if additional granularity is required.\
For example, multiple database profiles within the same environment.

Profiles provide **flexibility for advanced deployment scenarios** but are optional.

<figure><img src="/files/nsE2Rlky71QKytlnk6Ca" alt=""><figcaption></figcaption></figure>

***

#### Environment Variables

Within each environment (and profile, if applicable), users define **environment variables** that represent configuration parameters.

Typical examples include:

* `JDBC_URL`
* `JNDI_NAME`
* `SOAP_ENDPOINT`
* `REST_BASE_URL`

Each environment maintains its own values for these variables, while the variable name remains consistent.

<figure><img src="/files/tHOf9XosMYLwBDgjMRL2" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/HgAhvt3rhYNOkrfEBhnU" alt=""><figcaption></figcaption></figure>

***

### Using Environment Variables in Microflow and Process

Once defined, environment variables can be referenced directly within **Microflow** and **Process** node configurations.

#### Database Node

In Database Node configuration:

* Fields that support environment variables allow selecting a variable instead of entering a hard‑coded value
* An option such as **Use Environment** enables variable‑based configuration

This allows the same Microflow to connect to different databases depending on the execution environment.

***

#### Other Supported Nodes

The same environment variable mechanism can be applied to:

* Web Service endpoints
* Authentication credentials
* File paths (where supported)

This ensures that **integration logic remains unchanged**, while environment‑specific values are resolved at runtime.

***

### Best Practices for Environment Configuration

To ensure robust and secure deployments:

* Always externalize environment‑specific values
* Never hard‑code database URLs or service endpoints
* Use meaningful and consistent variable names
* Restrict sensitive values to secure environments
* Validate Microflows after switching or promoting environments

Following these practices significantly reduces deployment risk and configuration drift.

***

### Summary

**Environment Configuration** in ONEWEB enables Microflows and Processes to be deployed seamlessly across different environments.

With environment variables, teams can:

* Maintain a single Microflow definition
* Deploy safely to DEV, TEST, and PROD
* Reduce manual reconfiguration and errors
* Align with enterprise deployment and governance standards

This capability is essential for building **scalable, portable, and production‑grade integrations** using **Microflow Designer**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onewebstack.com/oneweb-platform-th/designer-reference/microflow-designer/environment-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
