External Bots

Level-up your chat bot by leveraging your organization's systems

Overview

An external bot is a set of client-owned logic that executes during the execution of a MedChat chat bot to retrieve data from or perform actions in a customer's system. The external bot can also post messages to and receive input from the patient. When the external bot is finished with its task(s), it returns control to the MedChat chat bot.

External bots are useful in situations where access to client-owned system(s) to perform a task or retrieve data is needed by the bot. At the appropriate time the MedChat chat bot passes control to the external bot, the external bot performs its task(s) - which might also involve interacting with the patient via the MedChat API - and then returns control of the chat back to the MedChat chat bot.

πŸ“˜

What do we mean by "external bot"?

The term "external bot" will be used throughout this guide to refer to the set of logic that lives outside of MedChat in a client's system and executes while a MedChat bot is paused on an "Execute external bot" chatbot step.

It refers not to a single concrete "thing," but rather the logical grouping of webhook event handlers and methods that live in a client-maintained service external to MedChat.

Why Would I Use an External Bot?

Possible uses for an external bot might include...

  • Displaying a list of possible appointment times and allowing the patient to schedule one.
  • Retrieving and displaying information about a patient's recent referral.
  • Verifying a patient's insurance information.
  • Verifying a patient's identity.
  • etc...

In short, an external bot is useful for accessing any data and/or actions that the MedChat bot is not privy to.

Example Chat High-Level Timeline

1243

A high-level timeline of an example chat involving an external bot.

πŸ“˜

Good bots take turns.

Only one bot can be in control of a chat at a time. The MedChat bot pauses execution when it gives control of a chat over to an external bot. The MedChat bot resumes execution again when it receives control of the chat back from an external bot.


What’s Next

Before diving into the nuts and bolts of building your external bot, let's cover some key concepts.