Share feedback, ideas and get community help

Updated 4 months ago

How to Handle Asynchronous Flows in Typebot: Pausing Indefinitely Until Client (User) Response?

I'm working on features where the flow needs to pause until the client performs a certain action. For example, in a WhatsApp Flow (https://developers.facebook.com/docs/whatsapp/flows/), the process should only continue once the client responds to a message. This is just one scenario, but I believe setting up a webhook to handle real-time information exchange could be a potential solution. Has anyone implemented something similar?

Note: I'm relatively new to Typebot, so any guidance would be greatly appreciated.
1
W
G
g
9 comments
In this case, you have an API endpoint with a single response. However, my challenge is that I need to wait for the client's response in the WhatsApp flow, which could be sent after 1 minute, 10 minutes, or at any other time. To handle this, it seems necessary to use a real-time webhook, similar to Socket.io. For instance, when an action called "client_answer" is triggered, the bot flow can proceed.
so you need to execute the api after the client sends a message? something like that?
Yes, that's correct. Using WhatsApp flow functionality, I can't continue the conversation until I receive a response from the client.
Not sure if this would work in your case, but the way I've handled something like this where I needed something external to happen was to run a loop with the wait block and then set the check interval. So say, every 5 seconds it checks for a response. If there is one it can get that response and continue if there isn't, it just loops again.

Maybe set the loop to timeout or killitself after like 200 iterations (or set it to send a message to the user "Are you still there?") and just do a few different follow up messages 2 or 3, then kill the loop. (I am not sure if you would need to kill the loop or not... but I wouldn't have it KEEP sending them messages and I'd think after a few hours or a day you might want it to stop).
I was doing mine to check if a database cell (actually google sheets) had been filled in from an api call.

So you can use something that CAN recieve a webhook like zapier, pabbly, make or even I think a database (maybe nocodb- love that one haven't tried anything like this). Then just keep checking that cell to see if it is set.
It would be NICE if it were possible to have some sort of inbound webhook ability to pause a flow and wait for an action from a specific identifier/hook to continue @baptiste - I'm sure this in the feature requests OR there is some limitation/issue with implementing something like this, correct?
I am considering using a similar approach to yours, incorporating periodic checks into the solution. However, I would like to confirm if there might be a more effective alternative approach. Any additional suggestions or recommendations would be greatly appreciated.
the above proposed solutions are the only one available to you right now since typebot is not built to act as a server (for webhooks).

It is a requested feature to will make chatwoot integrated right into typebot as well but @Baptiste may answer if he ever plans to build something like this into typebot.
Add a reply
Sign up and join the conversation on Discord