🐘 PostgreSQL
Query and manipulate PostgreSQL databases with SQL.
Overview
Query and manipulate PostgreSQL databases directly from your workflows. Run SELECT queries, insert rows, update records, or delete data using SQL with variable interpolation.
Configuration
- Credential — select a PostgreSQL database credential
- Operation — Execute Query, Insert, Update, or Delete
- SQL Query — your SQL statement with
{{variable}}interpolation - Output Variable — name for storing query results (default:
postgres_result)
SQL with Variables
SELECT * FROM users WHERE email = '{{$json.email}}'INSERT INTO logs (message, created_at) VALUES ('{{$json.message}}', NOW())UPDATE orders SET status = '{{$json.new_status}}' WHERE id = '{{$json.order_id}}'
Accessing Results
{{$json.postgres_result}}— array of result rows{{$json.postgres_result[0].column_name}}— access specific column from first row
Common Use Cases
- Lead enrichment — look up incoming leads in your database, enrich with AI, and update their record with scoring results
- Scheduled reporting — run aggregate queries on a cron schedule, generate AI summaries, and email reports to stakeholders
- Data sync — pull records from your Postgres database and push to external CRMs or SaaS tools via HTTP requests
- Audit logging — insert workflow execution results and AI outputs into an audit trail table for compliance