Using Variables
Weik.io 2026.1Use variables to manage configuration and secrets in integration flows.
On this page
Variables let you store configuration values and secrets outside of your code. This keeps database passwords and API keys out of your integration YAML files.
Variable syntax#
Integrations reference variables using Apache Camel’s system properties syntax inside application.properties files:
# Database configuration
database.url={{sys:DATABASE_CONNECTION}}
database.username={{sys:DB_USERNAME}}
database.password={{sys:DB_PASSWORD}}
# API configuration
api.key={{sys:EXTERNAL_API_KEY}}
api.endpoint={{sys:API_ENDPOINT}}System variables#
The platform automatically provides the following system variables to all integration flows:
| Variable Name | Description |
|---|---|
weikio. |
The unique identifier of the agent running the integration flow |
weikio. |
The URL of the NATS server (defaults to localhost if not configured) |
weikio. |
The username for NATS authentication |
weikio. |
The password for NATS authentication |
weikio. |
The file path to NATS credentials file |
Using system variables#
You can reference system variables directly in your integration flow configurations:
apiVersion: weik.io/v1alpha1
kind: IntegrationFlow
metadata:
name: nats-publisher
spec:
source:
uri: "timer:publish?period=5000"
steps:
- uri: "nats:events?servers={{sys:weikio.nats.url}}"Or map them in application.properties:
# NATS connection configuration
nats.url={{sys:weikio.nats.url}}
nats.username={{sys:weikio.nats.username}}
nats.password={{sys:weikio.nats.password}}
# Agent identification
agent.id={{sys:weikio.agent.id}}Creating variables#
Define custom variables using YAML manifests:
apiVersion: weik.io/v1alpha1
kind: Variable
metadata:
name: DATABASE_PASSWORD
description: PostgreSQL database password for production environment
spec:
value: "your-secure-password-here"
isSecret: true # Optional, defaults to falseApply the configuration using the CLI:
weikio config apply variable.yamlUsing variables in integration flows#
Variables are resolved at runtime when the integration starts:
apiVersion: weik.io/v1alpha1
kind: IntegrationFlow
metadata:
name: database-sync
spec:
source:
uri: "postgresql:{{DATABASE_CONNECTION}}"
parameters:
apiKey: "{{EXTERNAL_API_KEY}}"
enableFeatures: "{{ENABLE_BETA_FEATURES}}"Example application.properties:
# Database configuration
database.url={{sys:DATABASE_CONNECTION}}
database.username={{sys:DB_USERNAME}}
database.password={{sys:DB_PASSWORD}}
# Feature flags
features.beta={{sys:ENABLE_BETA_FEATURES}}Variable resolution process#
When an integration flow starts, the runner looks for variable references in your routes and properties. It fetches the matching values from Weik.io, injects them as environment variables, and lets Apache Camel handle the final resolution.
This keeps your secrets out of source control while Camel resolves the variables through its standard mechanism.
Common examples#
Database connection#
apiVersion: weik.io/v1alpha1
kind: Variable
metadata:
name: DATABASE_CONNECTION
description: PostgreSQL connection string for production database
spec:
value: "Server=prod-db.example.com;Port=5432;Database=myapp;User Id=app_user;Password=secret;"
isSecret: trueAPI key#
apiVersion: weik.io/v1alpha1
kind: Variable
metadata:
name: EXTERNAL_API_KEY
description: Authentication key for external service
spec:
value: "ak_live_12345abcdef"
isSecret: trueFeature flag#
apiVersion: weik.io/v1alpha1
kind: Variable
metadata:
name: ENABLE_BETA_FEATURES
description: Toggle for beta features in production
spec:
value: "true"
isSecret: falseManaging variables#
List all variables#
Use the API endpoint to view all variables (secret values are hidden):
GET /variablesGet a specific variable#
Retrieve a specific variable by name:
GET /variables/{name}Next steps#
- Integration Overview: Learn about integration flows
- First Integration: Build your first integration
- Database Change Tracking: Use variables with database tracking