Skip to main content

Infrastructure prerequisites

Before initiating the FlowX.AI Engine, ensure the following infrastructure components are properly installed and configured:
  • Kafka
  • Elasticsearch
  • PostgreSQL
  • MongoDB

Dependencies

The FlowX Engine interacts with various components critical for its operation:
  • Database: Primary storage for the engine.
  • Redis Server: Used for caching purposes. Refer to Redis Configuration.
  • Kafka: Facilitates messaging and event-driven architecture. Details on Configuring Kafka.
For a microservices architecture, it’s common for services to manage their data via dedicated databases.

Required External Services

  • Redis Cluster: Essential for caching process definitions, compiled scripts, and Kafka responses.
  • Kafka Cluster: Serves as the communication backbone with external plugins and integration.

Configuration Setup

FlowX.AI Engine utilizes environment variables for configuration. Below are the key environment variables you need to configure:

Database configuration

PostgreSQL

  • SPRING_DATASOURCE_URL - Database URL for PostgreSQL
  • SPRING_DATASOURCE_USERNAME - Username for PostgreSQL
  • SPRING_DATASOURCE_PASSWORD - Password for PostgreSQL
  • SPRING_DATASOURCE_DRIVER_CLASS_NAME - Driver class for PostgreSQL

Configuring MongoDB (runtime database - additional data)

The Process Engine requires to connect to Runtime MongoDB instance to access runtime build information. Use the following environment variables for configuration:
  • SPRING_DATA_MONGODB_RUNTIME_URI - URI for connecting to MongoDB for Runtime DB (app-runtime)
    • Format: mongodb://${RUNTIME_DB_USERNAME}:${DB_PASSWORD}@<host1>,<host2>,<arbiter-host>:<port>/${DB_NAME}?retryWrites=false
  • RUNTIME_DB_USERNAME: app-runtime
  • DB_NAME: app-runtime

Dynamic configuration parameters retrieval

The FlowX Engine supports dynamic retrieval of configuration parameters from Kubernetes secrets and ConfigMaps. This feature enables secure management of environment variables and sensitive configuration data without hardcoding values in the application.
You can configure multiple secrets and ConfigMaps by incrementing the index number (e.g., FLOWX_CONFIG_PARAMS_K8S_SECRETS_1, FLOWX_CONFIG_PARAMS_K8S_CONFIGMAPS_1). Values are overridden based on the order in which the maps are defined.

Kubernetes resources setup

To use this configuration, create the following resources in the cluster namespace where the platform operates:
  • Secret: Name specified in FLOWX_CONFIG_PARAMS_K8S_SECRETS_0 (default: flowx-rt)
  • ConfigMap: Name specified in FLOWX_CONFIG_PARAMS_K8S_CONFIGMAPS_0 (default: flowx-rt)

Authorization & access roles

This section outlines the OAuth2 configuration settings for securing the Spring application, including resource server settings, security type, and access authorizations.

Resource server settings (OAuth2 configuration)

Old configuration from < v4.1 releases:
  • SECURITY_OAUTH2_BASE_SERVER_URL: The base URL for the OAuth 2.0 Authorization Server, which is responsible for authentication and authorization for clients and users, it is used to authorize clients, as well as to issue and validate access tokens.
  • SECURITY_OAUTH2_CLIENT_CLIENT_ID: A unique identifier for a client application that is registered with the OAuth 2.0 Authorization Server, this is used to authenticate the client application when it attempts to access resources on behalf of a user.
  • SECURITY_OAUTH2_CLIENT_CLIENT_SECRET: Secret Key that is used to authenticate requests made by an authorization client.
  • SECURITY_OAUTH2_REALM: Security configuration env var in the Spring Security OAuth2 framework, it is used to specify the realm name used when authenticating with OAuth2 providers.
New configuration, starting from v4.1 release, available below.

Service account settings

This section contains the environment variables for configuring process engine service account. More details about the necessary service account can be found here.

Security configuration

Configuring Kafka

Kafka handles all communication between the FlowX.AI Engine and external plugins and integrations. It is also used for notifying running process instances when certain events occur.

Kafka connection settings

Kafka consumer retry settings

Consumer groups & consumer threads configuration

Both a producer and a consumer must be configured:

Configuring a Kafka Producer

Configuring a Kafka Consumer

Consumer groups & consumer threads

In Kafka a consumer group is a group of consumers that jointly consume and process messages from one or more Kafka topics. Each consumer group has a unique identifier called a group ID, which is used by Kafka to manage message consumption and distribution among the members of the group. Thread numbers, on the other hand, refer to the number of threads that a consumer application uses to process messages from Kafka. By default, each consumer instance runs in a single thread, which can limit the throughput of message processing. Increasing the number of consumer threads can help to improve the parallelism and efficiency of message consumption, especially when dealing with high message volumes. Both group IDs and thread numbers can be configured in Kafka to optimize the processing of messages according to specific requirements, such as message volume, message type, and processing latency. The configuration related to consumers (group ids and thread numbers) can be configured separately for each message type as it follows:

Consumer group configuration

Consumer thread configuration

It is important to know that all the events that start with a configured pattern will be consumed by the Engine. This makes it possible to create a new integration and connect it to the engine without changing the configuration.

Configuring Kafka topics

The suggested topic pattern naming convention is the following:

OPERATIONS_IN request example

BULK_IN request example

If you need to send additional keys on the response, attach them in the header, as in the following example, where we used requestID key.
A response should be sent on a callbackTopic if it is mentioned in the headers, as in the following example:
Task manager operations could be the following: assignment, unassignment, hold, unhold, terminate and it is matched with the ...operations.out topic on the engine side. For more information check the Task Management plugin documentation:📄 Task management plugin
Scheduler

Using the scheduler

Processes that can be started by sending messages to a Kafka topic

Configuring file upload size

The maximum file size allowed for uploads can be set by using the following environment variables:

Configuring Elasticsearch connection

The Process Engine uses Elasticsearch for process instance indexing and search capabilities. Configure the connection using these environment variables:
For indexing setup, check the Configuring Elasticsearch indexing section.

Connecting the Advancing controller

To use advancing controller, the following env vars are needed for process-engine to connect to Advancing Postgres DB:

Configuring the Advancing controller

Advancing controller setup

Configuring cleanup mechanism

This section contains environment variables that configure the scheduler’s behavior, including thread count, cron jobs for data partitioning, process cleanup, and master election.

Managing subprocesses expiration

This section details the environment variable that controls the expiration of subprocesses within a parent process. It determines whether subprocesses should terminate when the parent process expires or follow their own expiration settings.

Configuring application management

The FlowX helm chart provides a management service with the necessary parameters to integrate with the Prometheus operator. However, this integration is disabled by default.
Old configuration from < v4.1 releases (will be deprecated in v4.5):
  • MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED: Enables or disables Prometheus metrics export.
New configuration, starting from v4.1 release, available below. Note that this setup is backwards compatible, it does not affect the configuration from v3.4.x. The configuration files will still work until v4.5 release.
To configure Prometheus metrics export for the FlowX.AI Engine, the following environment variable is required:

RBAC configuration

Process Engine requires specific RBAC (Role-Based Access Control) permissions to ensure proper access to Kubernetes resources like pods for database lock management. This configuration enables the necessary RBAC rules.
  • rbac.create: Set to false to avoid creating additional RBAC resources by default. Custom rules can still be added if required.
  • rbac.rules: Define custom RBAC rules for database locking, as shown below.
Last modified on July 24, 2025