Trigger Event if User Abandons Chat (For Non Developers)

Abby Updated by Abby

If a user abandons a chat there are several actions we can take to get them to re-engage.

Here we will useย Pipedreamย to trigger an HSM template for users who didn't complete the flow

In this example, we wait 48 hours after the chat has been initiated, then use Pipedream to check the Landbot API to see if the variable we added for 'flow completed' is false, if so we send a follow up message with an HSM template

However, if we set the timer to 23 hours (within the 24 hour window) you could alsoย assign them to a webhook blockย to create a ticket inย Zendeskย orย Intercom, or simply send a message without the need to use HSM

The flow:

We can make our flow as complicated, or as simple as we'd like, the important things here are the variables and the Trigger Automation block

At the beginning of our flow we need a variable 'completedflow' that equals false, if you change the name of this variable you will need to change the code in Pipedream, so unless you have a developer it's not advised to change the name here

At the end of our flow we will change 'completedflow' to true, this means we won't send any follow up if they reach this point

Let's go to Pipedream now


The first module we use here is a trigger, this takes in the user ID from Landbot (we'll get to that later)

This is what the configuration will look like:

Next we'll copy the unique url that it gives us:

Let's go back to the bot, we'll add a Trigger Automation block with the following test values:

We'll test this using 'Test webhook trigger' just to be sure we've got the right url, it should return a 200 in Landbot, and the results should look like this in Pipedream:

Let's press continue

Next we'll add the workflow_delay module, we can select seconds, minutes, or hours. I've selected 48 hours for the bot in production, however for testing I've selected 8 seconds

Let's press continue

Next we'll add a Node.JS module, here you'll need to add your own API key where you see XXXXXX, and change the HSM template ID for the one you choose to send

You can paste the following code in the Node module:

import axios from 'axios';
export default defineComponent({
async run({ steps, $ }) {
const customerID =;
const res = await axios.get('' + customerID + '/', {
headers: { 'Authorization': 'Token XXXXXXXXXXXXXX' }});
let completedFlow =;
if(completedFlow == 'false'){
const options = {headers: {'Content-Type': 'application/json','Authorization': 'Token ' + auth}};
return await`${customerID}/send_template/`, {"template_id": 3424,"template_params": { "header": { "params": [] }, "body": { "params": [] }, "buttons":[ { "params": [] } ] },"template_language": "en"} , options)

Let's test, deploy and start using our workaround!

How did we do?

Two-Step Email Verification

Calculate Distances in WhatsApp