AutomationMart
Home/Browse/Export AI agent conversation logs from Postgres to Google Sheets
n8n

Export AI agent conversation logs from Postgres to Google Sheets

n8nn8n11 modulesv1.0
Google Sheets

Overview This n8n workflow retrieves AI agent chat memory logs stored in Postgres and pushes them to Google Sheets, creating one sheet per session. It’s useful for teams building chat-based products or agents and needing to review or analyze session logs in a collaborative format. Who is it for Anyone with an AI Agent in Production storing the conversation logs in Postgres (or Supabase) who wants to see transcript and have control Product teams building AI agents or assistants. Teams that wan

At a glance

Export AI agent conversation logs from Postgres to Google Sheets is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects Google Sheets. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
Google Sheets
Modules
11
Price
Free
Version
v1.0
Export AI agent conversation logs from Postgres to Google Sheets workflow diagram

About this workflow

Overview This n8n workflow retrieves AI agent chat memory logs stored in Postgres and pushes them to Google Sheets, creating one sheet per session. It’s useful for teams building chat-based products or agents and needing to review or analyze session logs in a collaborative format. Who is it for Anyone with an AI Agent in Production storing the conversation logs in Postgres (or Supabase) who wants to see transcript and have control Product teams building AI agents or assistants. Teams that want to centralize conversation history for analysis or support. Anyone managing AI chat memory and needing to explore it in a spreadsheet. Prerequisites A Postgres database with a n8nchathistories table with an AI Agent connected to it. If you need an example, you can follow this tutorial Once done, you need to run the Postgresql query to add the createdat column (see Setup > Add a datetime column) Google Sheets access and OAuth credentials connected to n8n. A Google Sheets document set up as a template (see below). Google Sheets Template This workflow expects a Google Sheets file where each session will be stored in its own tab. A basic tab layout is duplicated and renamed with the session ID. 👉 Use this template as a starting point Note: You can hide the template after the first tabs have been created How it works 1. Trigger The workflow can be launched manually or on a schedule (e.g. daily at noon). 2. Retrieve sessions Runs a SQL query to get distinct sessionid values from the n8nchathistories table. 3. Loop over sessions For each session: Clears the corresponding sheet (if it exists). Duplicates the template tab. Renames it with the current sessionid. 4. Fetch messages Selects all messages linked to the session from Postgres. 5. Append to sheet Adds each message to the Google Sheet with columns: Who: speaker role (user, assistant, etc.) Message: text content Date: timestamp from createdat, formatted yyyy-MM-dd hh:mm:ss Notes The sheet is cleared and rebuilt each run to ensure logs are up-to-date. If a sheet for a session doesn’t exist, it will be created by duplicating the first tab (template) You can group sessions under a persistent ID (like userid) by overriding sessionid in your memory config. Works perfectly with Supabase by using PG credentials from the connection pooler. 👉 If you're looking for a solution to better visualize and analyse conversations, reach out to us!

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Create a Gmail draft message from a new Google Sheets row

Use this template to create a Gmail draft message when a new row is added to your Google Sheets spreadsheet. To work with the template's default settings, your Google Sheets spreadsheet should contain these columns: Email address, Subject of the email and Content of the email.

Free

Add new subscribers to Emercury audience from Google Sheets

Every time a new row is added in a Google Sheet, Make will automatically create a subscriber in Emercury. This example uses the sheet in [this link](https://docs.google.com/spreadsheets/d/1l205VTOGWG-wurkvc2UmsbVnN0cJbX-6evHJnWcMfaM/edit#gid=0).

Free

Talk to your Google Sheets using ChatGPT-5

This n8n workflow template creates an intelligent data analysis chatbot that can answer questions about data stored in Google Sheets using OpenAI's GPT-5 Mini model. The system automatically analyzes your spreadsheet data and provides insights through natural language conversations. What This Workflow Does - Chat Interface: Provides a conversational interface for asking questions about your data - Smart Data Analysis: Uses AI to understand column structures and data relationships -

Free

Create Pastebin pastes from new Google Sheets rows

Every time a new row is added to your Google Sheets spreadsheet, Make will automatically create a paste for it.

Free

Automate e-commerce orders, inventory & feedback with Slack, Sheets & Gmail

How It Works ⚙️ This workflow acts as a central nervous system for your e-commerce operations, automating three critical areas: A. Order Fulfillment Notification 1. Webhook: New Order: 🚀 The workflow is instantly triggered when a new order is placed on your e-commerce platform (e.g., Shopify, WooCommerce) via a webhook. This provides real-time data to initiate fulfillment. 2. Extract Order Data (Function): 🧹 This node parses the incoming JSON data from the new order, extracting crucial details s

Free

AI-powered auto-generate exam questions and answers from Google Docs with Gemini

This workflow automates the creation of exam questions (both open-ended and multiple-choice) from educational content stored in Google Docs, using AI-powered analysis and vector database retrieval This workflow saves educators hours of manual work while ensuring high-quality, curriculum-aligned assessments. Let me know if you'd like help adapting it for specific subjects! --- Use Cases - Educators: Rapidly generate quizzes, midterms, or flashcards. - E-learning platforms: Automate question ban

Free

Audit & generate JSON-LD schema markup for SEO with GPT-4.1-mini + Gmail

Schema Markup Generator Automatically audit and optimize your site’s JSON-LD structured data and email a step-by-step implementation guide. --- What It Does Collects a website URL & email via form Extracts existing JSON-LD, identifies gaps Generates optimized schema markup (GPT-4.1-mini) Builds an HTML before/after guide with action items Emails the full implementation instructions --- Prerequisites n8n instance (self-hosted, Desktop, or Cloud) Gmail OAuth2 credentials OpenRouter API key

Free

Automate startup research & profiling with Extruct AI to Google Sheets

Who’s it for: Investors, analysts, and startup enthusiasts who need a complete overview of startups, including industry, product, funding, and leadership information. How it works / What it does: Enter a startup’s name into the form, and the workflow will automatically collect and organize details such as the company’s industry, product, investors, and key decision-makers. All this information is neatly updated in your Google Sheet, making it easy to track and compare startups. How to set up:

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free