Use the wait for action when you want to control the assistant behavior from your outside system.
The story begins by drag and dropping (Or simply clicking on) the Wait for action from the Actions menu on the left side of your assistant design canvas:
After that, you will need to click on the action to configure its needed parameters, you will need to put a timeout, the connection of the next coming action, and the fallback action.
After timeout finishes the action will fallback automatically, and during that time a message should be received from outside to push the bot to continue. If fallback is configured with a number of tries so the action will keep sending an error message for any user input until the tries finished then the action will fallback.
Use Cases
There might be several use cases to explain how that might work and what it solves. We published a use-case/example on the following to give some ideas:
Shipment/Same Day Delivery
Ask end-user for a feedback on same-day delivery of grocery
a. MindBehind lists products
b. The user picks what to buy via sending a message
c. MindBehind handles transactions via payment action
d. Mind Behind waits for an action from your store to send the user info about the delivery
d.1. Wait for action gets triggered by receiving an HTTP request
d.1.a. Received HTTP request with parameters explaining that the order shipped successfully
d.1.a.1. MindBehind sends a message to the end-user with parameters belonging to information about finalized delivery such as the delivery guy's name and delivery finalization date-time that is gathered from the HTTP request. ( see: Behavior)
d.1.a.2. MindBehind asks the end-user to enter a rate point for delivery service
d.1.a.3. User rates delivery service by sending a message
d.1.a.4. The conversation ends
d.1.b. Received HTTP request with some parameters explaining that the order cancelled for some reason
d.1.b.1. MindBehind sends end-user a message that says "The delivery is canceled for some reason, like no stock for that product and the amount has been refunded from store side"
d.1.b.2. MindBehind returns conversation back to a. again or end the conversation according to the user input
d.2. Wait for action gets timeout, which means fallback without parameters specifying the reason behind that
d.2.1. MindBehind sends message to the end-user that says sorry for being late
d.2.2. MindBehind sends HTTP request to the delivery service API to check delivery status and leave a warning alarm for regarding delivery via the integration module.
d.2.3. MindBehind sends messages to end-user about the current status of delivery considering data that is gathered from the integration module.
d.2.4. MindBehind returns conversation back to d. again.
Best case scenario for use-case : Order gets delivered until wait for third party module gets timeout
At (d), its expected that the delivery guy brings goods to end-user and clicks finalize delivery button on his application.
Finalize delivery button executes an HTTP request (d.1.a.) to MindBehind for triggering wait-for-action module with some parameters such as delivery guy's name and delivery finalization date-time. Whenever wait for an action module receives the HTTP request, the bot might move further with gathered parameters from received HTTP request. (d.1.a.1.) At this point, wait for action module has done its job. So we might move further with required-desired scenario as d.1.a.2,3,4.
Worst Scenario for use-case : Wait for action gets timeout before order gets delivered. Wait for an action has timeout parameter that is configurable on it. You can create such scenarios related with possible timeout occurrences on your business - way of work. In this use case, delivery might be get late, we might send an apologize message, check current status of delivery by using integration action to send HTTP request and gather information from response to send an informative message to end-user.
Wait for action will wait for specific type of message "THIRDPARTY" and will display an error message for other types of messages until fallback. You can send a message from your system outside to our system using the following info:
Defining a delay for this action will only add a delay until the action actively began to wait for "THIRDPARTY" message or any other message.