Archive every finished LiveChat conversation in Google Sheets

When a chat ends in LiveChat, the full transcript and its details land in one spreadsheet, and badly rated chats get flagged to your support leads in Slack.

Deterministic Code
LiveChatGoogle SheetsSlackCustomer SupportOperationsData SyncNotifications & AlertsFeedback Triage
PromptCreate

Build me a deterministic code workflow that archives every finished LiveChat conversation into Google Sheets, so we keep a searchable record that outlives LiveChat's own reporting retention. Trigger it with a webhook on LiveChat's chat_deactivated event, which fires whenever a chat is closed.

When the webhook fires, take the chat id from the payload and call LiveChat Get Chat to fetch the finished conversation, including its thread, the events in it, the users on it, and the thread properties. Everything the archive row needs comes straight out of that response, so there is no summarizing or judgement anywhere in this workflow. If Get Chat does not come back with the thread I need, fall back to LiveChat List Threads for that chat id and use the most recent closed thread.

Then append exactly one row to the archive tab of my spreadsheet with Google Sheets Append Values, in this column order: chat id, date, time, agent name, group, customer name, customer email, chat duration, tags, satisfaction rating, transcript. Date and time come from the first event in the thread, rendered in my local timezone as separate columns. Chat duration is the elapsed time between the first and last event in the thread, formatted as minutes and seconds. Agent name and group come from the agent user on the chat and the chat's group assignment. Customer name and email come from the customer user on the chat. Tags are the thread tags joined by commas, left empty when there are none. The satisfaction rating comes from the chat's rating property, written as good, bad, or not rated.

The transcript column holds the whole conversation as plain text. Walk the thread events in order, keep only the message events, and write each one on its own line prefixed by who said it, for example "Agent Maria: Hi, how can I help?" then "Customer: My order never arrived." Use the author's display name where LiveChat provides one and fall back to their role when it does not. No HTML and no JSON, just readable lines separated by newlines so the cell stays searchable with a normal spreadsheet find.

Always append, never update and never overwrite. Append Values adds rows after the last row of the detected table, which is exactly the behaviour I want here: the archive keeps growing and no history is ever lost. Write the header row once if the sheet is empty, then only ever add rows underneath it.

Add one simple check at the end. If the satisfaction rating is bad, also post into my support leads channel with Slack Send a Message, carrying the customer name and email, the agent who handled the chat, the chat id, the duration and the full transcript, so somebody can follow up the same day. If the rating is good or the chat was never rated, skip the Slack step and finish after the spreadsheet row is written.

Make the spreadsheet id, the tab name and the Slack channel configurable inputs. If a field is missing from the chat payload, write an empty cell rather than failing the run, and never let a failed Slack post stop the archive row from being written.

Example output

Spreadsheet row (transcript column): Agent Maria: Hi, thanks for waiting. How can I help? Customer: My order LC-4821 was supposed to arrive Tuesday and it never showed up. Agent Maria: I can see it is stuck at the depot. I have raised a replacement, shipping today. Customer: That still puts me a week late. Slack alert to #support-leads: Bad rating on chat TZ8K2QW9. Customer: Dana Whitfield (dana@example.com). Agent: Maria Alvarez. Group: Orders. Duration: 6m 12s. Transcript attached below for follow up today.

What does this prompt do?

  • Every time a LiveChat conversation is closed, one new row is added to your archive spreadsheet with the chat id, the date and time, the agent, the group, the customer name and email, how long the chat lasted, its tags and its rating.
  • The whole conversation is saved as readable text with every line labelled by who said it, so you can search months of old chats by keyword, customer or product name.
  • Rows are only ever added and never overwritten, so your history keeps growing even after LiveChat stops showing older conversations in its own reporting.
  • If the customer rated the chat badly, your support leads get a Slack message with the customer, the agent and the transcript so somebody can follow up the same day.

What do I need to use this?

  • A LiveChat account with access to read chats, and a plan that can notify other tools when a chat is closed
  • A Google account and a spreadsheet to use as your chat archive
  • A Slack workspace and a channel where your support leads can pick up unhappy customers

How can I customize it?

  • Change the columns you keep, or add your own such as the chat source, the page the customer started from, or their country
  • Choose which ratings raise the Slack alert: only bad ratings to start with, or every rated chat if you want fuller coverage
  • Send the alert to a different channel or a specific team lead, and reword the message to match how your team works

FAQs

Will this overwrite anything already in my spreadsheet?
No. Each finished chat is added as a new row underneath the last one, so nothing you already have is touched and the archive simply keeps growing.
What happens to chats nobody rated?
They are still archived in full, with the rating column marked as not rated. Only chats the customer rated as bad send a Slack message to your support leads.
Does it archive my old chats too?
It starts from the moment you switch it on and archives each conversation as it finishes. Chats that ended before then are not backfilled.
Why archive to a spreadsheet instead of just using LiveChat reporting?
LiveChat only keeps chat history for a limited period depending on your plan. A spreadsheet you own keeps the transcripts searchable for as long as you want, and lets you filter, pivot and share them freely.
Can I send the alerts somewhere other than Slack?
Yes. The alert step is separate from the archiving step, so you can swap it for a different chat tool or an email to your support leads without changing anything else.

Related templates

Auto-fix your calendar when a flight slips, and flag what's at risk

When your flight moves, your calendar times get corrected automatically and you get a Slack note naming the meetings you're about to miss.

Google Calendar
AviationStack
Slack
Agentic Task
Trace phishing emails to the sending IP and report abuse

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.

AbuseIPDB
Gmail
Slack
Agentic Task
Weekly Amazon S3 bucket security audit posted to Slack

Every Monday, check every S3 bucket for public exposure, missing encryption and weak backup settings, then get the risks ranked in Slack.

Amazon S3
Slack Bot
Google Sheets
Agentic Task
Turn procurement portal tenders into CRM deals each morning

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.

Anchor Browser
Google Sheets
HubSpot
+1
Agentic Task
Draft polite follow-ups for emails that never got a reply

Every weekday at 4pm, spot the threads that went quiet, stage a ready-to-send nudge in your mailbox, and get a ranked Slack recap.

Aurinko
Google Sheets
Slack Bot
Agentic Task
Turn each week's football fixtures into a venue staffing plan

Every Monday, rank the week's matches by expected demand, put the big ones on your venue calendar, and post a rota-ready summary to Slack.

API-Sports
Google Calendar
Slack
Agentic Task

Stop losing chat history to retention limits.

Keep every LiveChat conversation searchable in a spreadsheet you own, and catch unhappy customers the same day they chat.