Turn ended LiveChat conversations into HubSpot records
When a LiveChat conversation ends, we summarize it, file it on the right HubSpot contact, and flag real buying intent to your sales channel.
When a LiveChat conversation ends, I want an agent to turn it into a clean CRM record in HubSpot. Trigger this from a LiveChat webhook on the chat_deactivated event so it runs the moment an agent closes a chat.
Start by pulling the whole conversation. Use LiveChat Get Chat with the chat id from the webhook payload, then use LiveChat List Threads to walk every thread on that chat so you have the complete transcript rather than only the final exchange. Read the customer's messages, the agent's replies, and the pre-chat form fields.
Before doing anything else, apply two quality gates. Skip the chat entirely if there is no customer email address on the pre-chat form or the customer profile. Skip it too if the customer sent fewer than two messages. Bounced visitors and accidental widget opens should never pollute the CRM.
For chats that pass both gates, write a short summary of no more than a few sentences. Cover three things: what the customer asked about, what the outcome was (resolved, escalated, or waiting on us), and the customer's sentiment during the conversation.
Then handle the CRM record. Use HubSpot Search Contacts to look the customer up by the email from the pre-chat form. If no contact exists, create one with HubSpot Create Contact using that email plus whatever name and company details the chat gave you. Either way, attach the summary with HubSpot Create Note associated to that contact, and include the chat date and the agent who handled it.
Now judge intent. If the conversation shows real buying intent rather than a support issue, meaning signals like pricing questions, requests for a demo or trial, questions about plans and seats, or comparisons against competitors, do two extra steps. Open a deal with HubSpot Create Deal in the inbound pipeline, named after the company or the contact and associated to that contact. Then post to the sales channel using Slack Send a Message with the summary, the customer's name and email, the specific buying signal you spotted, and a reference back to the original chat.
Conversations that are purely support shaped, such as bug reports, how-to questions, or billing problems, should stop after the note. Do not create a deal and do not post to Slack for those.
What does this prompt do?
- Notices the moment a LiveChat conversation is closed and reads the full transcript, every message across the whole conversation rather than just the last exchange.
- Writes a short summary covering what the customer asked about, what the outcome was, and how the customer seemed to feel.
- Finds the customer in HubSpot using the email from your pre-chat form, adds them if they are new, and attaches the summary to their record.
- Spots genuine buying signals such as pricing questions, demo requests, or competitor comparisons, opens a deal in your inbound pipeline, and posts the details to your sales channel in Slack.
What do I need to use this?
- A LiveChat account with agents handling conversations
- Your LiveChat pre-chat form set up to collect the visitor's email address
- A HubSpot account where you keep contacts and deals
- A Slack workspace and the channel where your sales team wants lead alerts
How can I customize it?
- Change what counts as buying intent, for example treating any mention of a competitor or any request for a quote as sales-worthy.
- Point new deals at a different pipeline or opening stage, and send alerts to a different Slack channel per team or region.
- Adjust the quality filter, for example requiring three customer messages instead of two before a conversation reaches your CRM.
FAQs
Will this create a contact for every visitor who opens the chat widget?
What happens if the customer is already in HubSpot?
Does every conversation create a deal?
Will this work on HubSpot's free CRM?
How soon after a chat ends does it run?
Related templates
When your flight moves, your calendar times get corrected automatically and you get a Slack note naming the meetings you're about to miss.
Every 15 minutes, forwarded phishing reports get traced back to the server that really sent them, with a verdict in Slack and the worst senders reported.
Twice every weekday, the conversations from your social inbox land on the right HubSpot contact timelines, with a Slack recap for sales.
Every weekday at 7am, sign in to the tender portals you track, filter new notices against your bid criteria, and open a deal for the ones worth chasing.
Every morning, find the addresses that hard bounced or filed a spam complaint, update the matching HubSpot contacts, and post a short Slack recap.
When a HubSpot deal hits Closed Won, the customer's plan, seats and renewal dates land in your DynamoDB accounts table, with a Slack note showing what changed.
Stop losing sales leads in your chat inbox.
Every finished conversation lands in HubSpot as a clean, readable record, and the ones actually worth calling reach your sales team right away.