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 primary configuration for the Workflow Engine. It includes settings for the server, provider, and other components.

{
"server": {
"enableRealtimeKPI": false,
"port": 3000,
"instanceName": "workflow-instance",
"hostName": "localhost"
},
"provider": {
"type": "redis",
"config": {
"host": "127.0.0.1",
"port": "6379",
"password": ""
}
}
}

deployment-config.json

The deployment-config.json file contains deployment-specific configurations, such as the active model and other deployment-related settings.

{
"activeModel": "gpt4",
"deploymentEnvironment": "production"
}

Configuration Properties

ServerConfig

The ServerConfig interface defines the properties for configuring the server.

  • instanceIdentifiers: Identifiers for the server instances.
  • clusterName: The name of the cluster.
  • 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.
  • port: The port on which the server runs.
  • instanceName: The name of the server instance.
  • hostName: The hostname of the server.
  • role: The role of the server.

FileSystemConfig

The FileSystemConfig interface defines the properties for configuring the file system.

  • folderName: The name of the folder used for storing files.

RedisConfig

The RedisConfig interface 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.

ArbiterConfig

The ArbiterConfig interface 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.

WorkflowConfig

The WorkflowConfig interface 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.

PostgresConfig

The PostgresConfig interface defines the properties for configuring PostgreSQL.

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

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

Conclusion

This documentation provides a comprehensive guide on configuring the Workflow Engine. By understanding the configuration properties, CLI arguments, and environment variables, you can customize the engine to meet your specific requirements. Whether you are setting up the server, configuring Redis, or managing workflows, this guide covers all the essential aspects of configuration.

X

Graph View