← All N8N workflows
Data & databasesCodeFilterGoogle SheetsManual TriggerPostgres Trigger

receive postgres events and filter and appendorupdate google sheets

Configured with Filter, Google Sheets, Postgres Trigger. Review the connections and setup before adapting this template.

Workflow preview
TriggerPostgres TriggerPostgres TriggerRoutingFilterFilterTriggerOn clicking "ExecuteNode"Manual TriggerCodeCodeCodeData storeGoogle SheetsGoogle Sheets

Node categories in this workflow

  • Trigger
  • Routing
  • Code
  • Data store

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Postgres TriggerTriggerPostgres TriggerSee node parameters
FilterRoutingFilterSee node parameters
On clicking "Execute Node"TriggerManual TriggerSee node parameters
CodeCodeCodeSee node parameters
Google SheetsData storeGoogle SheetsappendOrUpdate

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • googleSheetsOAuth2Api
  • postgres

Workflow notes

Filter

Filter out @n8n.io emails

👋 How to use this template

👋 How to use this template

This template shows how to sync data from one service to another. In this example we're saving a new qualified lead to a Google Sheets file. Here's how you can test the template:

  1. Duplicate our Google Sheets file
  2. Double click the Google Sheets node and create a credential by signing in.
  3. Select the correct Google Sheets document and sheet.
  4. Click the Execute Workflow button and double click the nodes to see the input and output data

To customize it to you needs, just do the following:

  1. Enable or exchange the Postgres trigger with any service that fits your use case.
  2. Change the Filter to fit your needs
  3. Adjust the Google Sheets node as described above
  4. Disable or remove the On clicking "Execute Node" and Code node
2. Filter and transform your data

2. Filter and transform your data

In this case, we only want to save qualified users that don't have @n8n.io in their email address.

To edit the filter, simply drag and drop input data into the fields or change the values directly. Besides filters, n8n has other powerful transformation nodes like Set, ItemList, Code and many more.

3. Save the user in a Google Sheet

3. Save the user in a Google Sheet

For simplicity, we're saving our qualified user in a Google Sheet.

You can replace this node with any service like Excel, HubSpot, Pipedrive, Zendesk etc.

On clicking "Execute Node"

For testing the workflow

Code

Mock Data

Google Sheets

Add to "Users to contact"

receive postgres events and filter and appendorupdate google sheets

receive postgres events and filter and appendorupdate google sheets

Purpose and structure

This folder contains the receive postgres events and filter and appendorupdate google sheets workflow. Its executable nodes use code, filter, googleSheets, manualTrigger, postgresTrigger. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

Postgres Trigger, On clicking "Execute Node"

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Code/0307_Code_Postgres_Automate_Triggered.json MIT; preserve source notices.

Canvas section labels

These name areas of the original canvas; they do not include explanatory instructions.

  • 1. Trigger step listens for new events

More in Data & databases