Postgres
Query and modify any Postgres database directly via SQL
Postgres is an open-source relational database. This block connects to any Postgres-compatible database (Neon, Supabase raw, AWS RDS, Railway, Render, self-hosted, etc.) via a standard connection string and runs SQL directly.
In Agent Forge, the Postgres integration lets workflows read from and write to your own databases — pull customer rows, insert events, update statuses, or run analytical queries inside an automation. Use it for CRM sync, audit logging, custom data pipelines, agent memory backed by SQL, and any workflow that needs first-class data access.
This is a bring-your-own-key (BYOK) integration. The user supplies a connection string; the platform never persists credentials beyond per-user encrypted storage and only uses them server-side when the workflow runs.
Usage Instructions
Pick an operation and paste a Postgres connection string. The connection string format is postgres://user:password@host:port/database — the same format used by Neon, Supabase ("Direct connection" tab), AWS RDS, and most managed providers.
Queries support parameter binding via $1, $2, $3, ... placeholders. Pass a JSON array of values in the Parameters field — Postgres handles type coercion and escaping. Use parameterized queries to avoid SQL injection.
Tools
postgres_query
Run a SELECT query and return rows. Supports parameter binding.
postgres_insert
Insert one or more rows into a table. Pass either a single JSON object or a JSON array of objects in the Data field; column names are inferred from the object keys.
postgres_update
Update rows matching a WHERE clause. The Data field specifies the columns to set; the WHERE field uses $1, $2, ... placeholders backed by the Parameters array.
postgres_delete
Delete rows matching a WHERE clause. Returns the deleted rows by default (override with the Returning field).
postgres_execute
Execute any SQL statement (DDL, DML, CTEs, multi-statement scripts). Use this for CREATE TABLE, ALTER, batch updates, transactions, or anything outside the helper operations.
Common Inputs
| Parameter | Type | Required | Description |
|---|---|---|---|
connectionString | string | Yes | Postgres URI (postgres://user:pass@host:port/db) |
query | string | For Query | SELECT statement, optionally parameterized |
statement | string | For Execute | Any SQL statement |
table | string | For Insert/Update/Delete | Target table name |
data | string (JSON) | For Insert/Update | Row data — object or array of objects |
where | string | For Update/Delete | WHERE clause with $1, $2, ... placeholders |
parameters | string (JSON array) | No | Parameter values for placeholders |
returning | string | No | Columns to return (default *) |
sslMode | string | No | prefer, require, verify-full, or disable |
Output
| Parameter | Type | Description |
|---|---|---|
data | json | Array of rows returned by the operation |
rowCount | number | Number of rows returned/affected |
Notes
- Category:
tools - Type:
postgres - BYOK only. The platform does not host a database.
- Runs server-side only. Connection strings are never exposed to the browser.
- Use
$1,$2, ... placeholders for any user-supplied values to prevent SQL injection. - SSL defaults to
prefer; managed providers like Neon/Supabase generally requirerequire. - Works with any Postgres-compatible database: Postgres, Neon, Supabase, AWS RDS, Google Cloud SQL, Azure DB for Postgres, Railway, Render, Crunchy, Timescale, Citus, CockroachDB (Postgres-compatible mode).