Agent Forge

Postgres

Query and modify any Postgres database directly via SQL

po

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

ParameterTypeRequiredDescription
connectionStringstringYesPostgres URI (postgres://user:pass@host:port/db)
querystringFor QuerySELECT statement, optionally parameterized
statementstringFor ExecuteAny SQL statement
tablestringFor Insert/Update/DeleteTarget table name
datastring (JSON)For Insert/UpdateRow data — object or array of objects
wherestringFor Update/DeleteWHERE clause with $1, $2, ... placeholders
parametersstring (JSON array)NoParameter values for placeholders
returningstringNoColumns to return (default *)
sslModestringNoprefer, require, verify-full, or disable

Output

ParameterTypeDescription
datajsonArray of rows returned by the operation
rowCountnumberNumber 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 require require.
  • 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).