Variables Support
Weik.io 2026.1Manage configuration values and secrets across integration workflows.
On this page
Variables store configuration values and secrets so that you do not need to hardcode them in your integration workflows. The feature is based on Apache Camel’s built-in system properties variable support.
Configuration format#
Configure variables using YAML files that follow the standard Weik.io configuration pattern:
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 falseApplying configuration#
Use the Weik.io CLI to apply variable configurations:
weikio config apply filename.yamlAPI endpoints#
-
GET /variables- Returns all variables
- Secret values are hidden
-
GET /variables/{name}- Returns a specific variable by name
- Secret values are hidden
Usage in integration flows#
Integration flows can reference variables using Apache Camel’s system properties property placeholder syntax {{sys:VARIABLE}} in application.properties files.
Example integration flow using variables:
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}}
# API configuration
api.key={{sys:EXTERNAL_API_KEY}}
api.endpoint={{sys:API_ENDPOINT}}
# Feature flags
features.beta={{sys:ENABLE_BETA_FEATURES}}System variables#
The platform automatically provides system variables to all integration flows. These variables provide runtime context and configuration without requiring manual setup.
Available system variables#
| 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#
System variables use the same syntax as user-defined variables in Apache Camel: {{sys:variable-name}}. You can reference them in integration flow configurations and application.properties files.
Example application.properties using system variables:
# 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}}
# Using NATS credentials file
nats.credentials.path={{sys:weikio.nats.credentialsfilepath}}Example integration flow using system variables:
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}}"Usage in APIM configurations#
APIM configurations (ApiVersions and ApiSubscriptions) can use variables with the {{sys:VARIABLE}} syntax or static values. Variables are defined separately in the variables section of the configuration, which keeps variable definitions in one place.
Example ApiVersion using variables:
apiVersion: weik.io/v1alpha1
kind: ApiVersion
metadata:
name: v1
spec:
authentication:
type: "oidc"
parameters:
clientId: "{{clientId}}"
clientSecret: "{{clientSecret}}"
tokenEndpoint: "https://auth.example.com/token"
variables:
- clientSecret: "{{sys:OidcClients--ifstest--ClientSecret}}"
- clientId: myClientIdExample ApiSubscription using variables:
apiVersion: weik.io/v1alpha1
kind: ApiSubscription
metadata:
name: api-subscription
spec:
apis:
- myapi
parameters:
apiKey: "{{myApiKey}}"
clientId: "{{clientId}}"
variables:
- myApiKey: "{{sys:ApiSubscriptions--myapi--Key}}"
- clientId: static-client-id-123Usage in database change tracking#
Database change tracking configurations can use variables to manage database connection details and other sensitive information. Variables can be defined directly in the configuration and are resolved at runtime.
Example DatabaseChangeTracking using variables:
apiVersion: weik.io/v1alpha1
kind: DatabaseChangeTracking
metadata:
name: postgres-test
description: Track database changes on PostgreSQL example database
spec:
type: postgres
parameters:
databasePassword: Q0rZOxIAnnPGgkAN8UPxNk9o5kc3y4V1v8wi6P8L2USup..
databaseHostname: {{dbHost}}
databaseDbname: sampledb
databaseUser: {{user}}
variables:
- user: {{sys:postgress-username}}
- dbHost: {{sys:production-db}}This allows for:
- Managing sensitive database credentials through variables
- Environment-specific database configurations
- Consistent variable resolution across all database change tracking instances
The variable resolution happens at runtime through the following process:
- Integration runner detects environment variable references in routes and properties
- Variables are fetched from the Variables system
- Values are set as environment variables when starting the integration
- Apache Camel automatically resolves the variables during runtime
This allows for:
- Secure handling of sensitive information
- Environment-specific configurations
- Centralized management of shared values
- Native integration with Apache Camel’s variable resolution
- Consistent syntax across all configuration files
Usage 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: trueFeature flag#
apiVersion: weik.io/v1alpha1
kind: Variable
metadata:
name: ENABLE_BETA_FEATURES
description: Toggle for beta features in production
spec:
value: "true"
isSecret: falseAPI key#
apiVersion: weik.io/v1alpha1
kind: Variable
metadata:
name: EXTERNAL_API_KEY
description: Authentication key for external service
spec:
value: "ak_live_12345abcdef"
isSecret: trueFuture enhancements#
- Variable scopes (global, project, environment)
- Variable groups for organizing related variables
- Variable history and versioning support
- Variable references in other configurations
- Variable export/import functionality
- Integration with external secret management systems
- Support for complex variable transformations