Collect a Conversation from WhatsApp and send it as E-Mail

Hello,

I setup a Scenario where I can receive a WhatsApp message for my business, send it to an AI for a Response and send it back. Also in the first version, I got an email that show me what was asked and what was the response.

But obviously, I would get multiple emails for each part of the Dialog.

So I thought I store the Question and Answer in a Data Storage, Store an ID, search for the ID and build the Conversation in an HTML E-Mail. For that I wait for 60 Seconds (for Testing, Later 300 Seconds) until this Data is collected and send out.

That did not work, as each WhatsApp Message trigger the Scenario one time. So it is not the way how data is collected.

I thought, maybe I have to seperate it. Collect the Data only in one Scenario and create another Scenario that send the E-Mail after reading the Data out of the Data Storage. But that did not work, as I want one Conversation with one User and I cannot handover the ID to find it and did not know how I should Trigger, that the Communication is over.

Most likely their is a solution, but I did not see it (to many Trees, that I cannot see the Forest).

Any idea?

HEre is the Diagram and the Blueprint.

Frank

blueprint.json (73.9 KB)

As additional Information:

The Data Collection itself seems is working:

Searching by ID would find the complete Conversation, it is more a matter of how to workflow should be working.

2 Likes

Hello :blob_wave:,

I believe that the idea of storing WhatsApp messages in the Data Store including the conversation ID might be a good approach there.

Basically, scenario A would collect the messages and store them in the Data Store and scenario B would create “conversations” for the email message.

In case you would store also the date and time of the messages, you could always create an email with only the messages that were sent in a specific time period (e.g. 2 hours).

Scenario B could then look similarly as in the pictures below.



The "Search records" module searches all messages that were created during the scenario interval (e.g. 2 hours). This ensures only those messages that were not processed by previous executions will be processed.



4 messages in 2 different conversations are output.



The "Text aggregator" module aggregates messages into "conversations" and groups them into two because they will be grouped by their IDs.

This results in the email module sending 2 emails - one email per conversation.

I hope it helps.


Cheerio :cat_roomba:

2 Likes

WOW

That works right out of the Box. Many thanks.

Frank

3 Likes

Hi Jason,

I just wanted to jump in and share an approach that may be complementary to the approach you chose to follow.

We also created a bot using Chatbase and WhatsApp but with our connector [1]. It lets you connect your own WhatsApp number with the liberty and cost savings that using the free versions of WhatsApp brings.

[1] https://youtu.be/np2h8j7Cxm0?si=ziZ7zCfTJViBcqmN

2 Likes

What is the advantage for me to connect it to 2chat? Would I be able to jump into the conversation (Live Chat). because that is something that did not work right now. But from mY understanding that is a WhatsApp Issue, as I cannot have an App on the Developer Account for the Number to connect to make.com and associated the same Number with WhatsApp Business or WhatsApp on a Device.

Hi Frank,

Yes, you can jump into any conversation. We provide a link to a Live Chat with the interaction between the bot and the customer, with the ability to send messages into the conversation yourself if you want to.