Templates / Export AI agent conversation logs from Postgres to Google Sheets

Export AI agent conversation logs from Postgres to Google Sheets

Ready for 3.0

by Agent Studio ✓ · 1,201 views · created 2025-05-28 · Document Extraction

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This workflow has 11 nodes and runs manually, when you click “Execute workflow” (plus 1 other trigger). Along the way it connects Postgres and Google Sheets.

How it runs

Trigger: Manually, when you click “Execute workflow” (plus 1 other trigger).

  1. Postgres: run a query
  2. Loop Over Session IDs (Loop Over Items (Split in Batches)): loops over the items in batches
  3. Clear Sheet Content (Google Sheets): clear
  4. Get conversations by sessionId (Postgres): select
  5. Duplicate template sheet (HTTP Request): calls an HTTP API (POST)
  6. Add conversations (Google Sheets): append
  7. Rename Sheet (HTTP Request): calls an HTTP API (POST)
  8. Set session_id (Edit Fields (Set)): sets 1 field: session_id
  9. add create_at column (Postgres): run a query

Services it uses

PostgresGoogle Sheets

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (7)

From the author

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…

Excerpt from Agent Studio's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.