Registry / database / n8n-nodes-cloudsql-postgres

n8n-nodes-cloudsql-postgres

JSON →
library1.2.1jsnpmunverified

n8n community node v1.2.1 for Google Cloud SQL PostgreSQL, using the Cloud SQL Connector for authentication. Provides a database node (select, insert, update, upsert, delete, custom query) with batching modes and dynamic schema loading, plus a trigger node for LISTEN/NOTIFY and table row change events. Requires n8n-workflow peer dependency. Intended for self-hosted n8n only (n8n.strict = false, not eligible for n8n Cloud). Release cadence: irregular, open source. Supports IAM and password authentication via Service Account JSON or Application Default Credentials. Key differentiator: direct integration of Cloud SQL Connector for secure auth without IP whitelisting.

npm install n8n-nodes-cloudsql-postgres
INSTALL
IMPORT
SIG · N8N-NODES-CLOUDSQL
N
n8n-nodes-cloudsql-postgres
databasejavascriptv1.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CloudSqlPostgres
import { CloudSqlPostgres } from 'n8n-nodes-cloudsql-postgres'
const CloudSqlPostgres = require('n8n-nodes-cloudsql-postgres')
Package is ESM/CJS compatible; default export is the node class. Use named import.
node types in package.json
add to package.json: "n8n": { "nodes": ["n8n-nodes-cloudsql-postgres"] }
const { ... } = require('n8n-nodes-cloudsql-postgres'); try to import via path
This is an n8n community node; it must be declared in package.json under n8n.nodes to be discovered. Not installed via regular import.
CloudSqlPostgres node from n8n editor
Use n8n GUI; search for 'Cloud SQL (Postgres)'
import via require in workflow code
n8n nodes are not importable in workflow JavaScript. They are used via the editor UI.

Shows credential setup and a basic Execute Query operation, plus trigger configuration.

// 1. Install the package in your n8n instance: // npm install n8n-nodes-cloudsql-postgres (or via n8n community nodes UI) // 2. In n8n, add Cloud SQL (Postgres) credentials: // - Instance Connection Name: project:region:instance // - IP Type: PUBLIC (or PRIVATE/PSC) // - Authentication Type: PASSWORD (or IAM) // - Database: mydb // - Max Connections: 5 // - Google Auth Method: Service Account JSON Key // - Service Account JSON: <JSON content> // - User: myuser // - Password: mypass // 3. Add a Cloud SQL (Postgres) node to the workflow // 4. Set Operation: Execute Query // 5. Query: SELECT id, name FROM users WHERE status = $1 // 6. Query Parameters: active // 7. Run workflow. // Trigger example: // - Add Cloud SQL (Postgres) Trigger node // - Trigger mode: Table Row Change Events // - Schema: public // - Table: users // - Events: INSERT, UPDATE, DELETE // - Activate and run.
Debug
Known issues
gotchaPackage sets n8n.strict = false, making it ineligible for n8n Cloud. Must be self-hosted.
fix
Run on a self-hosted n8n instance. Cannot be submitted for n8n Cloud verification.
affects: >=1.0
gotchaThe peer dependency n8n-workflow is required. Installing without it will cause missing class errors.
fix
Ensure n8n-workflow is installed (it comes with n8n, but when developing locally, run npm install --include=dev).
affects: >=1.0
gotchaWhen using IAM authentication, the Service Account must have the Cloud SQL Client role and IAM database authentication enabled.
fix
Grant 'Cloud SQL Client' IAM role to the service account and enable 'Cloud SQL IAM authentication' on the database instance.
affects: >=1.0
gotchaThe trigger node's 'Table Row Change Events' automatically creates database triggers and functions. Cleanup when deactivating is not automatic.
fix
Manually drop the trigger and function when no longer needed, or use 'Advanced' mode on a pre-existing channel.
affects: >=1.0
deprecatedDatabase node versions 2-7 are deprecated; version 8 is recommended.
fix
Set node version to 8 in the node's Options section.
affects: 2 - 7
gotchaThe package relies on pg-promise for database connections. Ensure PostgreSQL is accessible from the n8n runtime (network/firewall).
fix
Verify network connectivity: for PUBLIC IP type, allowlist n8n IP; for PRIVATE, use VPC peering or VPN.
affects: >=1.0
Errors
Common errors & fixes
Error: Cannot find module 'n8n-workflow'
Missing peer dependency when developing locally or installing without n8n.
fix
Run: npm install n8n-workflow (or install inside n8n's node_modules directory).
Cloud SQL (Postgres) node not appearing in n8n editor
Package not declared in n8n.nodes in package.json or not installed via community nodes UI.
fix
Add "n8n": { "nodes": ["n8n-nodes-cloudsql-postgres"] } to your top-level package.json, then restart n8n.
Error: connect ECONNREFUSED ...:5432
Network connection refused; likely IP restriction or incorrect IP Type.
fix
Check Cloud SQL instance connection name and IP Type. For PUBLIC, ensure network allows egress to Cloud SQL IP. For PRIVATE, use VPC.
Error: Authentication failed for user ...
Wrong credentials or IAM misconfiguration.
fix
For PASSWORD: check user/password. For IAM: ensure service account has Cloud SQL Client and DB user is set up with IAM auth (e.g., CREATE USER ... WITH AUTHENTICATION CLOUD IAM).
Upgrade
Version history
1.2.1latest on npm
Audit
Dependencies
n8n-workflowrequiredcore n8n dependency; required to define node types
Agent activity
4 hits · last 30 days
node
4
Resources
n8n-nodes-cloudsql-postgres — npm install n8n-nodes-cloudsql-postgres · libregistry