Share feedback, ideas and get community help

Updated 3 months ago

Is it possible to set a sessionId for a typebot using API?

Hello everyone, I would like to keep my WhatsApp flow within Chatwoot.

To do this, I thought about creating a webhook in n8n and creating a Bot in Chatwoot that addresses n8n.

n8n would receive this webhook, call a method to create or retrieve an existing chat. From there, it would mediate between Chatwoot and Typebot.

Currently, for this, I would need to keep the sessionId and relate it to the conversation ID in Chatwoot. I didn't want to use a database for this, so my question is:

Is it possible to define your own sessionId code?
i
H
6 comments
You need DB to play with it, currently my setup is like yours and i using postgreDB to store sessionID, resultID, user number & name:

Chatwoot Webhook > if sessionID not equal on DB > Preffiled variable with Chatwoot conversationID and Hit typebot startchat endpoint then save it to DB > else > hit typebot continuechat endpoint

So on typebot you can send Bot message as private note with send message Chatwoot API based on conversationID that you send from prefilled variable

But on my case you can scale and combine it with whatsapp api webhook on another workflow in n8n so you can playaround with all whatsapp type message
And you cant setup custom sessionID because its auto generate when you hit startchat endpoint on typebot and its stick forever so you must setup another flow to delete sessionID on your DB like when agent assign on chatwoot or whatever event you want
Thank you for sharing your methods.
I managed to do it in a relatively simple way
I created a custom conversation attribute in Chatwoot. When a message arrives, I check if the conversation does not have this attribute filled in, then I generate a sessionId and store it in the conversation attribute.
So I reached my goal using 100% of the APIs of both solutions with n8n intermediating
Add a reply
Sign up and join the conversation on Discord