visit
NOTE: This article is not about a ready-to-use chatbot. Instead, it is about an approach to building your very own chatbot platform inspired by a BPMN engine.
Chatbots address the modern-day demand for instant, on-demand customer service.
They provide:
And much more without human intervention, saving time and resourcesfor businesses.
With the ability to understand conversations, chatbots can provide personalized experiences, helping users do business over conversations.
Consider business flows as a flow diagram resembling a conversation blueprint where each activity requests and gets data from the user and completes a business use case. This enhances the user experience by guiding interactions in a structured, logical manner.
State Management - Manage the state of each conversation.
Conversation Isolation - Handle multiple conversations without cross-interference.
Conversation Builder UI - Support CRUD of business flows with a good user interface.
Parallel Conversations - Make conversations about different business use cases at a time with end users.
Multi Chat Interface - Support for multiple messaging platform interfaces like WhatsApp for user interaction with chatbot.
BPMN (Business Process Model and Notation) and BPMN Engine
is like a universal language designed for businesses to clearly and visually represent their processes. Imagine you're drawing out a roadmap of how a particular task or process is completed within your organization, from start to finish, with all the steps in between; that's what BPMN helps you do—a good fit for our conversation blueprint.
Now, onto the BPMN engine. Think of it like the director of a play. It follows the script and the BPMN diagram and tells everyone (or every part of the system) what to do and when to do it to ensure the process runs smoothly from start to finish. The BPMN engine, like, reads the BPMN diagram, which, in our case, will be the conversation blueprint, and executes each step, helping the chatbot to pursue the conversation.
In simple terms, BPMN helps draw out the conversation blueprint, and the BPMN engine brings that conversation to life!
BPMN and its components will be used extensively in further reads. Please check out the
BPMN Component | Description | Conversation Use-Case for Chatbot |
---|---|---|
Start Event | Indicates the start of the process and execution. | To start the conversation. |
Service Task | Service APIs process executables. | To execute the business logic and decide the following message. |
User Task | Executables are processed manually by users. | Capture the data and complete the task by the end-user or the system. |
Script Tasks | Scripts like JavaScript process executables. | Any use case where scripts have to be executed without the load of a service task |
Timer Boundary Event | Starts the timer flow if the execution waits for the time specified. | To auto-close the conversation after a specific idle time |
Error Boundary Event | To catch the unexpected error in task execution. | Self explanatory. |
Exclusive Gateway | It helps to model decision-based flow. One flow satisfying the condition will be executed. | If the conversation proceeds with different paths based on some conditions. |
Parallel Gateway | It helps to model decision-based flow. All the flows satisfying the condition will be executed. | Parallel execution, like sending a notification to the system in the background. |
Event Sub-process Interrupt-based | Process within the primary process. It can be executed with a start event like an escalation event. | Common conversation flow where the user would like to close the conversation at any time in the main conversation. |
Escalation Start Event | They are used for starting a sub-process by listening to specific escalations identified by their name. | Start the event of the common conversation flow like starting a close conversation flow. |
Escalation End Event | This event can end the primary process and trigger the sub-process listening to the escalation start identified by name. | To trigger the start of the close conversation flows from the main conversation. |
Send and Receive Tasks. | Executables present in the same process workflow or different workflows that can be used for inter-communication between them. Identified by similar names in both send and receive tasks. | Use cases like the driver arrived webhook process informing the user conversation flow. Here, Driver-side and User-side processes are different. |
End Event | Indicates the end of the process and execution. | To end the conversation. |
Camunda workflow engine is the core service Camunda provides to manage and orchestrate the BPMN diagrams. One of the standout features of the Camunda Workflow Engine is its ability to handle high-throughput scenarios while maintaining a low-latency performance. It is built to be developer-friendly, offering REST and Java APIs for easy integration and a comprehensive set of tools for monitoring and maintaining deployed workflows.
Camunda Modeler is a powerful, desktop-based modeling tool that allows designing and configuring BPMN workflows, DMN decisions, and more. It provides a user-friendly interface to create precise process models. One of the noteworthy features of Camunda Modeler is its ability to integrate with the Camunda platform seamlessly.
Camunda Cockpit is an advanced web-based tool designed for monitoring and managing business process workflows and decisions in real-time. Its primary aim is to offer a clear view of the current state and performance of processes and decisions deployed on the Camunda platform.
Using Camunda and the Spring Boot framework, my team and I have built a production-ready chatbot framework called Karna. The Whatsapp messaging platform has been used as the user interface for end-user interaction. And multiple business use cases, including booking a ride, have been used as services provided by the chatbot.
🏆 I am happy to inform you that Karna has won the Grand Prize at the “Bengaluru Open Mobility Challenge' 23“hackathon hosted by Namma Yatri.