Prerequisites
- A PostgreSQL database (self-hosted, RDS, Cloud SQL, Supabase, or compatible) reachable from AgentRuntime
- A connection string (DSN) with credentials scoped to the operations your workflows need
SELECTfor reporting;INSERT/UPDATE/DELETEonly when workflows must write- TLS configured for production (
sslmode=requireor stricter in the DSN) - project_contributor access
Connect in AgentRuntime
1
Create a connection
Go to Connections and click New custom connection to create a connection string connection with your Postgres DSN:Use a read-only role for reporting workflows. Grant write privileges only when steps call
postgres_exec.2
Add postgres MCP instance
Go to MCP, click Add instance for postgres, wire your connection on Instance config, set the profile active, and save.
3
Test with a health check
Add a workflow with a single mcp_call to
postgres_health. Run it to confirm connectivity before adding production queries.4
Explore schema (optional)
Run mcp_call →
postgres_list_schemas and postgres_list_tables to verify the bound database and default schema (public).What you can build
- Operational reports — Scheduled
postgres_queryon KPI tables → LLM narrative → Gmail or Resend digest. - Enrichment pipeline — External API fetch →
postgres_execINSERT with$1args → downstream sync to Google Sheets. - Approval-gated writes — human_task before
postgres_execUPDATE/DELETE on production tables. - Schema-aware agents —
postgres_list_tables+postgres_describe_table+postgres_explain_query→ Autopilot answers with grounded SQL.
Tools
Example
Fetch pending orders for a daily report:lua_script step:
Configuration
Troubleshooting
Related
- Integrations quickstart
- MySQL connector — similar SQL patterns for MySQL
- Connector catalog
- Troubleshooting