The Task Management plugin is available as a Docker image and serves as a dedicated microservice within the FlowX platform ecosystem.
Dependencies
Before setting up the plugin, ensure you have the following dependencies:
A MongoDB database for task storage
A connection to the RuntimeDB for operational data
Access to the database used by the FlowX Engine
Connection to the Kafka instance used by the FlowX Engine
A Redis instance for caching and performance optimization
While many configuration properties come pre-configured, several environment variables must be explicitly set for proper functionality.
Authorization configuration & access roles
Configure the following variables to connect to your identity management platform:
Environment Variable Description Default Value SECURITY_OAUTH2_BASESERVERURLBase URL of your OpenID Connect provider - SECURITY_OAUTH2_CLIENT_CLIENTIDClient ID for authentication - SECURITY_OAUTH2_CLIENT_CLIENTSECRETClient secret for authentication - SECURITY_OAUTH2_REALMSecurity realm for the application - SECURITY_OAUTH2_SERVICEACCOUNT_ADMIN_CLIENTIDService account client ID for process initiation flowx-task-management-plugin-saSECURITY_OAUTH2_SERVICEACCOUNT_ADMIN_CLIENTSECRETService account client secret -
A dedicated service account must be configured in your OpenID provider to allow the Task Management microservice to access realm-specific data and perform operations.
OpenID connect settings
The Task Management plugin supports Microsoft Entra ID as an OpenID provider.
Environment Variable Description Default Value OPENID_PROVIDERType of OpenID provider keycloak (possible values: keycloak, entra)OPENID_ENTRA_TENANTIDTenant ID for Microsoft Entra ID - OPENID_ENTRA_PRINCIPALIDPrincipal ID for Microsoft Entra ID - OPENID_ENTRA_GRAPHSCOPEGraph scope for Microsoft Entra ID https://graph.microsoft.com/.default
For more detailed information about configuring the service account:
Task Management Service Account
FlowX Engine datasource configuration
The service needs access to process instance data from the engine database. Configure these connection parameters:
Environment Variable Description Default Value SPRING_DATASOURCE_URLJDBC URL for the engine database jdbc:postgresql://onboardingdb:5432/onboardingSPRING_DATASOURCE_USERNAMEDatabase username postgresSPRING_DATASOURCE_PASSWORDDatabase password password
MongoDB configuration
Configure access to the primary MongoDB instance:
Environment Variable Description Default Value SPRING_DATA_MONGODB_URIMongoDB connection URI mongodb://${DB_USERNAME}:${DB_PASSWORD}@mongodb-0.mongodb-headless,mongodb-1.mongodb-headless,mongodb-arbiter-0.mongodb-arbiter-headless:27017/task-management-pluginDB_USERNAMEMongoDB username task-management-pluginDB_PASSWORDMongoDB password password
Task Manager requires a runtime connection to function correctly. Starting the service without a configured and active runtime MongoDB connection is not supported.
Runtime MongoDB configuration
Task Manager requires a runtime connection to function correctly. Starting the service without a configured and active runtime MongoDB connection is not supported.
Enable the Runtime MongoDB connection:
Environment Variable Description Default Value SPRING_DATA_MONGODB_RUNTIME_ENABLEDEnable runtime MongoDB connection trueSPRING_DATA_MONGODB_RUNTIME_URIURI for connecting to MongoDB Runtime mongodb://${RUNTIME_DB_USERNAME}:${DB_PASSWORD}@mongodb-0.mongodb-headless,mongodb-1.mongodb-headless,mongodb-arbiter-0.mongodb-arbiter-headless:27017/app-runtime?retryWrites=falseRUNTIME_DB_USERNAMEUsername for runtime database app-runtimeRUNTIME_DB_PASSWORDPassword for runtime database password
Redis configuration
Configure the Redis cache with these parameters:
Configure the Redis cache with these parameters:
Environment Variable Description Default Value SPRING_REDIS_HOSTRedis server hostname or IP address localhostSPRING_REDIS_PORTRedis server port 6379SPRING_REDIS_PASSWORDAuthentication password for Redis passwordREDIS_TTLTime-to-live for cached items (milliseconds) 5000000
Kafka configuration
Configure the Kafka integration using these environment variables:
Core Kafka settings
Environment Variable Description Default Value SPRING_KAFKA_BOOTSTRAPSERVERSAddress of the Kafka server(s) localhost:9092SPRING_KAFKA_SECURITYPROTOCOLSecurity protocol for Kafka connections PLAINTEXTSPRING_KAFKA_CONSUMER_GROUPIDConsumer group identifier kafka-task-management-consumerKAFKA_MESSAGE_MAX_BYTESMaximum message size (bytes) 52428800 (50MB)KAFKA_AUTHEXCEPTIONRETRYINTERVALRetry interval after authorization exceptions (seconds) 10KAFKA_CONSUMER_THREADSNumber of consumer threads 3KAFKA_CONSUMER_EXCLUDEUSERSTHREADSNumber of threads for processing user exclusion events 3
Topic naming configuration
Environment Variable Description Default Value KAFKA_TOPIC_NAMING_SEPARATORPrimary separator for topic names .KAFKA_TOPIC_NAMING_SEPARATOR2Secondary separator for topic names -KAFKA_TOPIC_NAMING_PACKAGEPackage prefix for topic names ai.flowx.KAFKA_TOPIC_NAMING_ENVIRONMENTEnvironment segment for topic names dev.KAFKA_TOPIC_NAMING_VERSIONVersion suffix for topic names .v1
Kafka topics
Process management topics
Environment Variable Description Default Value KAFKA_TOPIC_PROCESS_START_OUTTopic for running hooks ai.flowx.dev.core.trigger.start.process.v1KAFKA_TOPIC_PROCESS_OPERATIONS_OUTTopic for task operations (assign, unassign, etc.) ai.flowx.dev.core.trigger.operation.v1KAFKA_TOPIC_PROCESS_OPERATIONS_BULKOUTTopic for bulk operations on tasks ai.flowx.dev.core.trigger.operations.bulk.v1
Scheduling topics
Environment Variable Description Default Value KAFKA_TOPIC_PROCESS_SCHEDULE_INTopic for receiving scheduler messages for hooks ai.flowx.dev.plugin.tasks.trigger.run.hook.v1KAFKA_TOPIC_PROCESS_SCHEDULE_OUT_SETTopic for setting schedules ai.flowx.dev.core.trigger.set.schedule.v1KAFKA_TOPIC_PROCESS_SCHEDULE_OUT_STOPTopic for stopping schedules ai.flowx.dev.core.trigger.stop.schedule.v1
User management topics
Environment Variable Description Default Value KAFKA_TOPIC_EXCLUDEUSERS_SCHEDULE_INTopic for user exclusion events ai.flowx.dev.plugin.tasks.trigger.exclude.users.v1
Task operations topics
Environment Variable Description Default Value KAFKA_TOPIC_TASK_INTopic for incoming task creation messages ai.flowx.dev.plugin.tasks.trigger.save.task.v1
Events and integration topics
Environment Variable Description Default Value KAFKA_TOPIC_EVENTSGATEWAY_OUT_MESSAGETopic for Events Gateway messages ai.flowx.dev.eventsgateway.receive.taskmanager.commands.message.v1KAFKA_TOPIC_RESOURCESUSAGES_REFRESHTopic for resource usage refresh events ai.flowx.dev.application-version.resources-usages.refresh.v1
The Engine listens for messages on topics with specific naming patterns. Ensure you use the correct outgoing topic names when configuring the Task Management plugin to maintain proper communication with the engine.
Logging configuration
Control logging verbosity with these environment variables:
Environment Variable Description Default Value LOGGING_LEVEL_ROOTRoot Spring Boot microservice logs - LOGGING_LEVEL_APPApplication-level logs INFOLOGGING_LEVEL_MONGO_DRIVERMongoDB driver logs INFOLOGGING_LEVEL_REDISRedis/Lettuce client log level OFF
Filtering feature
Environment Variable Description FLOWX_ALLOW_USERNAME_SEARCH_PARTIALEnables filtering possible assignees by partial names
Scheduled jobs
Configure scheduled maintenance jobs:
Environment Variable Description Default Value SCHEDULER_USERSCACHESCLEANUP_CRONEXPRESSIONCron expression for user cache cleanup 0 0 0 * *? (daily at midnight)
Resource usage monitoring
The plugin includes a resource usage monitoring feature that can be configured:
Environment Variable Description Default Value FLOWX_LIB_RESOURCESUSAGES_ENABLEDEnable resource usage tracking trueFLOWX_LIB_RESOURCESUSAGES_REFRESHLISTENER_ENABLEDEnable refresh listener trueFLOWX_LIB_RESOURCESUSAGES_REFRESHLISTENER_COLLECTOR_THREADCOUNTNumber of threads for resource collection 5FLOWX_LIB_RESOURCESUSAGES_REFRESHLISTENER_COLLECTOR_MAXBATCHSIZEMaximum batch size for collection 1000FLOWX_LIB_RESOURCESUSAGES_KAFKA_CONSUMER_GROUPID_RESOURCESUSAGES_REFRESHConsumer group for resource usage refresh events taskMgmtResourcesUsagesRefreshGroupFLOWX_LIB_RESOURCESUSAGES_KAFKA_CONSUMER_THREADS_RESOURCESUSAGES_REFRESHNumber of threads for processing resource usage events 3
Database migration
The Task Management plugin uses Mongock for MongoDB migrations:
Environment Variable Description Default Value MONGOCK_CHANGELOGSSCANPACKAGEPackage to scan for database change logs ai.flowx.task.management.config.mongock