Templates / Sync Gmail emails to PostgreSQL with S3 attachment storage

Sync Gmail emails to PostgreSQL with S3 attachment storage

Ready for 3.0

by Jose Cuartas · 313 views · created 2025-09-23 · 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 19 nodes and runs on Gmail events (plus 1 other trigger). Along the way it connects Postgres, S3 and Gmail.

How it runs

Trigger: On Gmail events (plus 1 other trigger).

  1. Get Individual Message (Gmail): get
  2. Get Many Sent (Gmail): get many
  3. Get Many Inbox (Gmail): get many
  4. Binary Data Filter (Filter): keeps only the items that match a condition
  5. Merge: merges the data from its input branches
  6. Email to PostgreSQL Transform (Code): runs custom JavaScript code
  7. Extract Binary Metadata (Code): runs custom JavaScript code
  8. Upload to Storage (S3): upload
  9. Final Merge (Merge): merges the data from its input branches
  10. Split Attachments (Split Out): splits a list into separate items

…plus 5 more steps. See the full node list below.

Services it uses

PostgresS3Gmail

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.

  • Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Gmail Trigger).

Nodes used (13)

From the author

Sync Gmail emails to PostgreSQL with S3 attachment storage Automated Gmail Email Processing System Who's it for Businesses and individuals who need to: - Archive email communications in a searchable database - Backup email attachments to cloud storage -…

Excerpt from Jose Cuartas'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.