Skip to main content
The notifications plugin handles both the actual OTP code generation and sending the code to the user using a defined notification template.

Define needed Kafka topics

DEVELOPER: Kafka topic names can be set/found by using the following environment variables in your Notifications plugin deployment:
  • KAFKA_TOPIC_OTP_GENERATE_IN β€” the OTP generate request is sent on this topic. Default: ai.flowx.plugin.notification.trigger.generate.otp.v1
  • KAFKA_TOPIC_OTP_GENERATE_OUT β€” after the OTP is generated and sent to the user, the response is sent back to the Engine on this topic. Default: ai.flowx.engine.receive.plugin.notification.generate.otp.results.v1
The Engine is listening for messages on topics with names of a certain pattern, make sure to use an outgoing topic name that matches the pattern configured in the Engine.

Request to generate an OTP

Send the request on the KAFKA_TOPIC_OTP_GENERATE_IN topic. The body holds the following values:
You don’t send the OTP code yourself. The plugin generates it and automatically injects it into the template data under the reserved key otpValue before rendering β€” see Notification template below.
The contentParams field is deprecated. Use data instead.

Notification template

The OTP code is delivered using a notification template created in Content Management β†’ Notification Templates. In the template Body, reference the generated code with the #otpValue placeholder (this maps to ${otpValue} in the Source view):
In the template Data model, declare the parameters the template expects. otpValue holds the generated code; any other parameters (such as name) are taken from the data object in the request:
You never pass otpValue in the request β€” the plugin adds it automatically. The number of digits in the code is controlled by the FLOWX_OTP_LENGTH environment variable (default: 4).

Response from generate OTP

The response is sent back to the Engine on the KAFKA_TOPIC_OTP_GENERATE_OUT topic. The reply body holds the following values:

Example: generate an OTP from a business flow

This example uses a simple process with a Kafka send node (to request the OTP) and a Kafka receive node (to capture the response): Identify the business identifier you will use to validate the OTP (for example, a user identification number).
  1. Configure the notification template that you want to use (for example, a MAIL template).
  2. Make sure the Kafka communication through the KAFKA_TOPIC_OTP_GENERATE_IN topic (send the OTP request) and the topic used to receive the response (KAFKA_TOPIC_OTP_GENERATE_OUT) is defined properly.
You can check the defined topics by going to FlowX Designer β†’ Platform Status β†’ notification-plugin-mngt β†’ kafkaTopicsHealthCheckIndicator β†’ details β†’ configuration β†’ topic β†’ otp.
  1. Add a Kafka send action to the correct node in the process definition. Set the topic to KAFKA_TOPIC_OTP_GENERATE_IN and configure the message body:
  1. Add a Kafka receive node and configure the process key where the response is stored (for example, otpResult).
  2. When the process runs, the response lands on that key, confirming the OTP was sent:
  1. The recipient receives the OTP code rendered from the notification template:
Last modified on June 9, 2026