Skip to main content

Workflow Engine Configuration

This documentation provides a comprehensive guide on configuring the Workflow Engine. It covers the configuration files, properties, CLI arguments, and environment variables that can be used to customize the engine's behavior.

Configuration Files

host-config.json

The host-config.json file contains the Workflow Engine's clustering configuration, such as the port, cluster name and authorization key.

{
"server": {
"clusterName": "wfe-cluster",
"hostName": "localhost",
"port": 7515,
"instanceName": "PrimaryArbiter",
"role": "arbiter",
"instanceIdentifiers": ["node-1"],
"authorizationKey": "[workflow-ui-authorization-key]",
"globalPrefix": "/bc/engine",
"keepAliveInSeconds": 5,
"enableLog": false,
"enableRealtimeKPI": false
},
"provider": {
"type": "redis"
}
}

The server section defines the properties for configuring the server.

  • clusterName: The name of the cluster.
  • hostName: The hostname of the server.
  • port: The port on which the server runs.
  • instanceName: The name of the server instance.
  • role: The role of the server.
  • instanceIdentifiers: Identifiers for the server instances.
  • authorizationKey: The key used for authorization.
  • globalPrefix: A global prefix for the server.
  • keepAliveInSeconds: The keep-alive interval in seconds.
  • enableLog: Whether logging is enabled.
  • enableRealtimeKPI: Whether real-time KPI is enabled.

The provider section defines the properties for the provider.

  • type: The type of provider.

deployment-config.json

The deployment-config.json file contains the configuration for the Workflow Engine itself, such as the connection details for the Redis and PostgreSQL databases, and any addtional sections for custom workflow specific configuration.

{
"arbiter": {
"thresholdFailedAttemptToProcess": 3,
"messageLockTimeoutInSeconds": 15,
"orphanedSnapshotTimeoutInSeconds": 10,
"lockSafeIntervalInSeconds": 2
},
"workflow": {
"idleTimeoutInSeconds": 300,
"timeAfterWaitCallToHibernateInSeconds": 10,
"workflowDeadlineInMinutes": 1440
},
"postgres": {
"host": "postgres",
"database": "wfe",
"username": "postgres",
"password": "[password]",
"port": "5432"
},
"sqlite": {
"database": "wfengine"
},
"redis": {
"host": "redis",
"port": "6379",
"password": "",
"cacheToPostgresFlushTimeoutInMinutes": 5
},
...
}

The arbiter section defines the properties for configuring the arbiter.

  • thresholdFailedAttemptToProcess: The threshold for failed attempts to process messages.
  • messageLockTimeoutInSeconds: The timeout for message locks in seconds.
  • orphanedSnapshotTimeoutInSeconds: The timeout for orphaned snapshots in seconds.
  • lockSafeIntervalInSeconds: The interval for lock safety checks in seconds.

The workflow section defines the properties for configuring workflows.

  • idleTimeoutInSeconds: The idle timeout for workflows in seconds.
  • timeAfterWaitCallToHibernateInSeconds: The time after a wait call to hibernate in seconds.
  • workflowDeadlineInMinutes: The deadline for workflows in minutes.

The postgres section defines the properties for configuring PostgreSQL.

  • host: The PostgreSQL host.
  • database: The PostgreSQL database name.
  • username: The PostgreSQL username.
  • password: The PostgreSQL password.
  • port: The PostgreSQL port.

The redis section defines the properties for configuring Redis.

  • host: The Redis host.
  • port: The Redis port.
  • password: The Redis password.
  • cacheToPostgresFlushTimeoutInMinutes: The timeout for flushing the cache to PostgreSQL in minutes.

The sqlite section defines the properties for configuring SQLite.

  • database: The SQLite database name.

Command Line Arguments

The Workflow Engine can be configured using various CLI arguments. These arguments allow you to customize the behavior of the engine at runtime.

Available CLI Arguments

  • --config <path>: Specifies the path to the configuration file.
  • --port <number>: Specifies the port on which the server should run.
  • --instanceName <name>: Specifies the name of the server instance.
  • --hostName <name>: Specifies the hostname of the server.
  • --enableLog: Enables logging.
  • --enableRealtimeKPI: Enables real-time KPI.
  • --keepAliveInSeconds <number>: Specifies the keep-alive interval in seconds.
  • --authorizationKey <key>: Specifies the authorization key.
  • --clusterName <name>: Specifies the name of the cluster.

Example Usage

node server.js --config ./config/host-config.json --port 3000 --instanceName workflow-instance --enableLog

Environment Variables

In addition to configuration files and CLI arguments, the Workflow Engine can be configured using environment variables. These variables allow you to set configuration options without modifying the code or configuration files.

Available Environment Variables

  • CONFIG_PATH: Specifies the path to the configuration file.
  • PORT: Specifies the port on which the server should run.
  • INSTANCE_NAME: Specifies the name of the server instance.
  • HOST_NAME: Specifies the hostname of the server.
  • ENABLE_LOG: Enables logging.
  • ENABLE_REALTIME_KPI: Enables real-time KPI.
  • KEEP_ALIVE_IN_SECONDS: Specifies the keep-alive interval in seconds.
  • AUTHORIZATION_KEY: Specifies the authorization key.
  • CLUSTER_NAME: Specifies the name of the cluster.

Sample usage in a script or command line:

export CONFIG_PATH=./config/host-config.json
export PORT=3000
export INSTANCE_NAME=workflow-instance
export ENABLE_LOG=true
node server.js
X

Graph View