complex-teal•17mo ago
Flow External trigger
Can VoiceFlow trigger a flow from a new external event updated by an 3rd API ?
13 Replies
Yes, Voiceflow can trigger a flow from an external event updated by a third-party API. This can be achieved using the Custom Actions feature in Voiceflow.
Custom Actions in Voiceflow are similar to event handlers. They allow a Voiceflow application to pause on a Custom Action step and wait for your client application to send back an event, a Custom Action request, telling the Voiceflow diagram which logic it should execute next.
Here's how a Custom Action works:
1. Your user interacts with your client app, for example, saying "talk to a human".
2. This interaction triggers a Custom Action in your Voiceflow application.
3. Your client application can then perform a variety of tasks, including triggering navigation on your website, processing a credit card payment, opening the windows on a car, handing off the call to a human, or rendering a custom user interface element.
4. Once these tasks are completed, your client application sends back an event to the Voiceflow application, indicating which logic it should execute next.
This feature is particularly useful if you want to allow your user to select a Carousel Button later in a conversation. The lastevent system variable will capture the trace of the last user event such as a button selection, carousel button selection, and when an intent is triggered.
For more detailed information, you can refer to the Custom Actions documentation and the Designing Backend Processes with API Steps and Custom Actions guide.
You can also use the dialogue API
genetic-orange•17mo ago
What are you trying to do exactly @Reach?
complex-tealOP•16mo ago
hey @MikeG
i try to trigger a flow (that starts with an Intent box in my Voiceflow canva) from our own external API.
For example :
1. Our flow requires a credit card payment from the user .
2. The user pays
3. The money is transfered
4. We got the code 200 in our own API, confirming that the payment is done.
5. We want our API to trigger a new flow "Payment confirmed" that unlock the next steps for the user.
How to do it ?
thanks man
genetic-orange•16mo ago
Currently, you cant initiate a message to the user from Voiceflow itself. The user needs to initiate the message. So as a work-around, you could make like a button "check payment status" and make an API call to your system that checks if the payment has been processed, and loop them back to the button if not, and if yes put them in the payment success flow 🙂
complex-tealOP•16mo ago
Would it possible to send a message on behalf of the user through twillio for example which would initiate a intent trigger without the user triggers the intent by himself ?
genetic-orange•16mo ago
You could, but the user would never receive a message. How the Webchat works is it sends an HTTP request to Voiceflow and uses the response as the reply to the user
So you can advance the user's flow forward, but the webchat never sent the request through the dialog API, so the webchat wont display anything
complex-tealOP•16mo ago
We don’t use webchat. We use WhatsApp. We don’t care if the user see the API auto-generated message or not
we just want to find a way to trigger Intent
as we can not do it through APIs directly, we need to find an alternative solution.
What comes to my mind is to send a message on behalf of the user on Whatsapp. If the user can not see the message, its even better as it works totally in the background and would trigger the intent (and so the flow) like magic
genetic-orange•16mo ago
Ok ye that can be done then 🙂 So the next time the user sends a message, their state will be inside that intent 🙂
complex-tealOP•16mo ago
can you elaborate please ?
what would clearly happen on the user side on Whatsapp ?
genetic-orange•16mo ago
Nothing, the user wouldnt see anything. Their "state" in voiceflow would move forward, and the next time they send a message it will be in the flow that their "state" is in
But the user wouldnt see anything change on their side, only then next time they send a message
complex-tealOP•16mo ago
would the "ghost" message sent on behalf of the user trigger an intent and its following flow ?
In our example :
1- Our flow requires a credit card payment from the user .
2- The user pays
3- The money is transfered
3- We got the code 200 in our own API, confirming that the payment is done.
4- We want our API to trigger a new flow "Payment confirmed" that unlock the next steps for the user.
would our "ghost" message be able to trigger the step N°4 ? Possible ?
can you elaborate please ? @W. Williams (SFT)
rare-sapphire•16mo ago
https://discord.com/channels/1079548823610871889/1243602070930718811
I'm doing what @W. Williams (SFT) told you, to change the intent via API. I discuss the method and limitations on the thread Ive linked above.