Supported actions
Prerequisites
- A PostgreSQL database reachable from the platform runtime.
- A database user with only the privileges required by the tools. Enable Read Only in the profile when the connection should reject all writes.
- The database host, port, database name, username, and password. The default port is
5432.
Set up the integration
1
Create a Postgres auth profile
In Integrations, select Postgres > Connect. On Project Auth Profiles, select New Profile > Integration Profile > Postgres > Continue. Keep API Key as the auth type. Enter the profile name, host, port, user, and database, then enter the database password in API Key. Use SSL and Verify Server Certificate are enabled by default. Keep certificate verification enabled where possible. Enable Read Only when the connection should reject every write, then select Create Profile.
2
Create the action tool
In Tools, select New Tool > Action Tool > Postgres. Select an action and auth profile, configure its inputs, and select Create Tool. Then assign the tool to an agent.
Action reference
Get Tables
Get Tables
This action has no input parameters. It returns the tables and views visible to the database user, with their schemas. Use it to discover available data.
Get Table Schema
Get Table Schema
Returns the table’s column names, data types, nullability, defaults, and primary key information. Use this action before writing a query or row action when the schema is unknown.
Find Rows
Find Rows
Results include
rows, rowCount, and truncated. When truncated is true, pass the returned nextOffset as the next offset. The result may not include a total rowCount until the final page.Insert Row
Insert Row
Returns the stored row, including database defaults and generated IDs.
Update Rows
Update Rows
Returns
rowCount, the number of rows changed. A non-empty match is required, so this action cannot update every row by leaving the match empty.Delete Rows
Delete Rows
Returns
rowCount, the number of rows deleted. A non-empty match is required, so this action cannot delete every row by leaving the match empty.Run Query
Run Query
Results include
rows, rowCount, and truncated. When truncated is true, pass nextOffset as the next offset. Add an ORDER BY clause for stable pages. Queries time out after 30 seconds.Security: Never interpolate dynamic values into the SQL string. Use $1, $2, and the args array so values are bound by the connector. For example, use SELECT * FROM employees WHERE department_id = $1 with the department ID as the first argument.