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 VariableDescriptionDefault 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 initiationflowx-task-management-plugin-sa
SECURITY_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 VariableDescriptionDefault Value
OPENID_PROVIDERType of OpenID providerkeycloak (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 IDhttps://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 VariableDescriptionDefault Value
SPRING_DATASOURCE_URLJDBC URL for the engine databasejdbc:postgresql://onboardingdb:5432/onboarding
SPRING_DATASOURCE_USERNAMEDatabase usernamepostgres
SPRING_DATASOURCE_PASSWORDDatabase passwordpassword

MongoDB configuration

Configure access to the primary MongoDB instance:

Environment VariableDescriptionDefault Value
SPRING_DATA_MONGODB_URIMongoDB connection URImongodb://${DB_USERNAME}:${DB_PASSWORD}@mongodb-0.mongodb-headless,mongodb-1.mongodb-headless,mongodb-arbiter-0.mongodb-arbiter-headless:27017/task-management-plugin
DB_USERNAMEMongoDB usernametask-management-plugin
DB_PASSWORDMongoDB passwordpassword

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 VariableDescriptionDefault Value
SPRING_DATA_MONGODB_RUNTIME_ENABLEDEnable runtime MongoDB connectiontrue
SPRING_DATA_MONGODB_RUNTIME_URIURI for connecting to MongoDB Runtimemongodb://${RUNTIME_DB_USERNAME}:${DB_PASSWORD}@mongodb-0.mongodb-headless,mongodb-1.mongodb-headless,mongodb-arbiter-0.mongodb-arbiter-headless:27017/app-runtime?retryWrites=false
RUNTIME_DB_USERNAMEUsername for runtime databaseapp-runtime
RUNTIME_DB_PASSWORDPassword for runtime databasepassword

Redis configuration

Configure the Redis cache with these parameters:

Configure the Redis cache with these parameters:

Environment VariableDescriptionDefault Value
SPRING_REDIS_HOSTRedis server hostname or IP addresslocalhost
SPRING_REDIS_PORTRedis server port6379
SPRING_REDIS_PASSWORDAuthentication password for Redispassword
REDIS_TTLTime-to-live for cached items (milliseconds)5000000

Kafka configuration

Configure the Kafka integration using these environment variables:

Core Kafka settings

Environment VariableDescriptionDefault Value
SPRING_KAFKA_BOOTSTRAPSERVERSAddress of the Kafka server(s)localhost:9092
SPRING_KAFKA_SECURITYPROTOCOLSecurity protocol for Kafka connectionsPLAINTEXT
SPRING_KAFKA_CONSUMER_GROUPIDConsumer group identifierkafka-task-management-consumer
KAFKA_MESSAGE_MAX_BYTESMaximum message size (bytes)52428800 (50MB)
KAFKA_AUTHEXCEPTIONRETRYINTERVALRetry interval after authorization exceptions (seconds)10
KAFKA_CONSUMER_THREADSNumber of consumer threads3
KAFKA_CONSUMER_EXCLUDEUSERSTHREADSNumber of threads for processing user exclusion events3

Topic naming configuration

Environment VariableDescriptionDefault Value
KAFKA_TOPIC_NAMING_SEPARATORPrimary separator for topic names.
KAFKA_TOPIC_NAMING_SEPARATOR2Secondary separator for topic names-
KAFKA_TOPIC_NAMING_PACKAGEPackage prefix for topic namesai.flowx.
KAFKA_TOPIC_NAMING_ENVIRONMENTEnvironment segment for topic namesdev.
KAFKA_TOPIC_NAMING_VERSIONVersion suffix for topic names.v1

Kafka topics

Process management topics

Environment VariableDescriptionDefault Value
KAFKA_TOPIC_PROCESS_START_OUTTopic for running hooksai.flowx.dev.core.trigger.start.process.v1
KAFKA_TOPIC_PROCESS_OPERATIONS_OUTTopic for task operations (assign, unassign, etc.)ai.flowx.dev.core.trigger.operation.v1
KAFKA_TOPIC_PROCESS_OPERATIONS_BULKOUTTopic for bulk operations on tasksai.flowx.dev.core.trigger.operations.bulk.v1

Scheduling topics

Environment VariableDescriptionDefault Value
KAFKA_TOPIC_PROCESS_SCHEDULE_INTopic for receiving scheduler messages for hooksai.flowx.dev.plugin.tasks.trigger.run.hook.v1
KAFKA_TOPIC_PROCESS_SCHEDULE_OUT_SETTopic for setting schedulesai.flowx.dev.core.trigger.set.schedule.v1
KAFKA_TOPIC_PROCESS_SCHEDULE_OUT_STOPTopic for stopping schedulesai.flowx.dev.core.trigger.stop.schedule.v1

User management topics

Environment VariableDescriptionDefault Value
KAFKA_TOPIC_EXCLUDEUSERS_SCHEDULE_INTopic for user exclusion eventsai.flowx.dev.plugin.tasks.trigger.exclude.users.v1

Task operations topics

Environment VariableDescriptionDefault Value
KAFKA_TOPIC_TASK_INTopic for incoming task creation messagesai.flowx.dev.plugin.tasks.trigger.save.task.v1

Events and integration topics

Environment VariableDescriptionDefault Value
KAFKA_TOPIC_EVENTSGATEWAY_OUT_MESSAGETopic for Events Gateway messagesai.flowx.dev.eventsgateway.receive.taskmanager.commands.message.v1
KAFKA_TOPIC_RESOURCESUSAGES_REFRESHTopic for resource usage refresh eventsai.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 VariableDescriptionDefault Value
LOGGING_LEVEL_ROOTRoot Spring Boot microservice logs-
LOGGING_LEVEL_APPApplication-level logsDEBUG
LOGGING_LEVEL_MONGO_DRIVERMongoDB driver logsINFO
LOGGING_LEVEL_REDISRedis/Lettuce client log levelOFF

Filtering feature

Environment VariableDescription
FLOWX_ALLOW_USERNAME_SEARCH_PARTIALEnables filtering possible assignees by partial names

Scheduled jobs

Configure scheduled maintenance jobs:

Environment VariableDescriptionDefault Value
SCHEDULER_USERSCACHESCLEANUP_CRONEXPRESSIONCron expression for user cache cleanup0 0 0 * *? (daily at midnight)

Resource usage monitoring

The plugin includes a resource usage monitoring feature that can be configured:

Environment VariableDescriptionDefault Value
FLOWX_LIB_RESOURCESUSAGES_ENABLEDEnable resource usage trackingtrue
FLOWX_LIB_RESOURCESUSAGES_REFRESHLISTENER_ENABLEDEnable refresh listenertrue
FLOWX_LIB_RESOURCESUSAGES_REFRESHLISTENER_COLLECTOR_THREADCOUNTNumber of threads for resource collection5
FLOWX_LIB_RESOURCESUSAGES_REFRESHLISTENER_COLLECTOR_MAXBATCHSIZEMaximum batch size for collection1000
FLOWX_LIB_RESOURCESUSAGES_KAFKA_CONSUMER_GROUPID_RESOURCESUSAGES_REFRESHConsumer group for resource usage refresh eventstaskMgmtResourcesUsagesRefreshGroup
FLOWX_LIB_RESOURCESUSAGES_KAFKA_CONSUMER_THREADS_RESOURCESUSAGES_REFRESHNumber of threads for processing resource usage events3

Database migration

The Task Management plugin uses Mongock for MongoDB migrations:

Environment VariableDescriptionDefault Value
MONGOCK_CHANGELOGSSCANPACKAGEPackage to scan for database change logsai.flowx.task.management.config.mongock