Replied Last user message variable in Pabbly chatflow

Grant Account Access for Support
  1. I authorize the Pabbly Support Team to access my account for troubleshooting purposes.
WhatsApp Number
+9718005775
Email Address
[email protected]
I am looking to send the last message received from the user.

I want to capture it, compare it and send it to Pabbly Connect.

Usecase:

User send a message --> if number send to Pabbly connect
else --> run the flow in chatflow.
 
I do nt what you understood.
What I mean is the most recent message form user.

I also do not know what will be the last user message.

is there anything for most recent message?
 

ArshilAhmad

Well-known member
Staff member
No, there is no trigger step that automatically checks for and triggers the flow based on the most recent message. A flow can be triggered when a specific keyword is received, when a user starts a conversation, when a user replies using a quick reply button, when a WhatsApp template is sent, and so on. There is no trigger available that checks for the most recent message and triggers the flow based on it.

1772656005924.png


Thanks & Regards,
Arshil Ahmad
Customer Support Associate
🌐 Pabbly.com
👉Rate your support
 

Preeti Paryani

Well-known member
Staff member
Hi @Viswanatha Reddy,

If your goal is to process the user's message in Pabbly Connect when it contains a phone number, you can achieve this using a webhook approach.

Steps you can follow:
  1. In Pabbly Chatflow, go to API & Webhooks.
  2. Add a webhook for the Message Received event and connect it to a Pabbly Connect webhook trigger.
  3. In the workflow, add Text Formatter (Pabbly) → Extract Pattern.
  4. Use the following regex to detect a phone number:
(\+?\d[\d\s\-]{7,}\d)
  1. If a number exists in the message, it will appear in the Result field.
  2. Add a Filter step and check that the Result field is not empty.
  3. After the filter passes, you can proceed with the required actions in the workflow.
For the other scenario (when the message does not contain a number), you can handle it directly in Pabbly Chatflow by creating a flow with the trigger Keyword/Regex Match and using the following regex that ensures the text does not contain a phone number:
^(?!.*(\+?\d[\d\s\-]{7,}\d)).*$
This way:
  • Messages containing a phone number → processed in Pabbly Connect
  • Messages without a phone number → handled in Chatflow flow
 

Preeti Paryani

Well-known member
Staff member
Hi @Viswanatha Reddy,

Both Pabbly Connect and Pabbly Chatflow will process the incoming message.

In Pabbly Connect, the webhook will trigger for every message. However, we have added a Filter after extracting the phone number, which ensures that the workflow proceeds only when a number is detected in the message. If no number is found, the execution will stop at the filter.

For Pabbly Chatflow, the trigger we suggested uses a regex condition that only matches messages without a phone number, so those messages will be handled directly in Chatflow.

There may be a slight timing difference between the two processes, but they will work according to their respective conditions. So there is nothing to worry about.
 

Preeti Paryani

Well-known member
Staff member
Hi @Viswanatha Reddy,

Could you please share the setup for both Pabbly Connect and Chatflow so we can review them and assist you better?

Kindly provide:
  • The Pabbly Connect workflow URL
  • The Chatflow flow URL
  • The email associated with both accounts
Once we have these details, we will review the configuration and help you resolve the issue.
 

roneysider

Member
Hi @Preeti Paryani I also have a question related to sending information contained in the last message typed by the user in the Pabbly Chatflow to Pabbly Connect. Currently, the only way I've found is by inserting a custom question variable, but I don't want only the user's messages via questions to be sent; I want all the user's messages to be sent to Pabbly Connect. Is there any other way to do this? Thank you.
 

ArshilAhmad

Well-known member
Staff member
You can set up Pabbly Chatflow: New Message Received as the trigger step in your workflow. This will allow you to capture all the messages received in Pabbly Connect.
1778286182626.png


Thanks & Regards,
Arshil Ahmad
Customer Support Associate
🌐 Pabbly.com
 

Preeti Paryani

Well-known member
Staff member
Hey @roneysider,

Could you please elaborate a bit more on your use case and what exactly you are trying to achieve?

If you have already created any workflow/flow for this setup, kindly share it with us so that we can better understand the requirement and assist you accordingly.

Also, if your requirement is to send the data or responses generated from other nodes in the Pabbly Chatflow to the Pabbly Connect webhook, then you can first save those responses into custom fields and later use those dynamic custom fields as parameters while sending the data to the webhook.

Please let us know if your concern is different from what we explained above.
 

roneysider

Member
In my workflow, to send a message from Pabbly Chatflow to Pabbly Connect, I have to use the structure below. The downside is that I always have to include the first box, which is a question block, and write a question duration.
1778317478440.png

@Preeti Paryani What I would like is that, in a normal conversation where I don't have to ask a question, when I receive a message, it can be recognized directly in Pabbly Connect.

And then I can use the received message in other Pabbly Connect nodes via variable mapping. For example like this:
1778317870385.png
 

Preeti Paryani

Well-known member
Staff member
Hey @roneysider,

Thanks for clarifying your use case.

Yes, this is possible. You can set up your Pabbly Connect workflow using the "Pabbly Chatflow: New Message Received" trigger.

As soon as a new message is received in Pabbly Chatflow, the trigger will capture the message details along with the user's phone number and other related information automatically in Pabbly Connect.

You can then directly map and use those received message values in the following workflow steps/actions through dynamic field mapping using /, without necessarily using a question block in Chatflow.
 

roneysider

Member
Hey @roneysider,

Thanks for clarifying your use case.

Yes, this is possible. You can set up your Pabbly Connect workflow using the "Pabbly Chatflow: New Message Received" trigger.

As soon as a new message is received in Pabbly Chatflow, the trigger will capture the message details along with the user's phone number and other related information automatically in Pabbly Connect.

You can then directly map and use those received message values in the following workflow steps/actions through dynamic field mapping using /, without necessarily using a question block in Chatflow.
Hey @Preeti Paryani, it isn't so clear yet. What kind of information should be setup in API Request block in Pabbly Chatflow to the message be recognized in Pabbly Connect and appear along with the phone number?

1778325527678.png

1778325674822.png
 

Preeti Paryani

Well-known member
Staff member
Hey @roneysider,

It seems there is a bit of confusion here.

Please note that to capture messages in the Pabbly Connect "Pabbly Chatflow: New Message Received" trigger, you do not need to create a flow inside Pabbly Chatflow.

This webhook trigger simply needs to be configured inside the "API & Webhooks" section of Pabbly Chatflow. Once configured, whenever a new message is received in Chatflow, it will automatically trigger your Pabbly Connect workflow, and then you can perform the required actions there.

In this particular use case, creating a Pabbly Chatflow flow is generally not required.

You can refer to the following thread to understand how to configure the webhook properly:
https://forum.pabbly.com/threads/api-webhooks.27064/
 

roneysider

Member
Now this alternative is clear.

A new question. I initially want to maintain communication with the user via Pabbly Chatflow automation, and at a certain point in the conversation migrate to the Pabbly Chatflow integration: New Message Received. How can I do this? That is, we want to keep my main communication in Chatflow and only at a certain point use the webhook integration in Pabbly Connect.

Something like this:

Conversation in Chatflow >>> Interaction in Pabbly Connect >>> Conversation in Chatflow
 

ArshilAhmad

Well-known member
Staff member
When you set up the Pabbly Chatflow: New Message Received trigger step in your Pabbly Connect workflow in the manner stated above, it will capture each and every message you receive. It is not possible to receive only specific messages.

Now, for your use case, if you want the conversation to begin in Pabbly Chatflow, you can do that and then send the data to Pabbly Connect in the manner shown in the video shared below.

You can then create a separate flow that gets triggered based on certain keywords or template responses, so the conversation can continue in Pabbly Chatflow.

Thanks & Regards,
Arshil Ahmad
Customer Support Associate
🌐 Pabbly.com
 
Top