Skip to main content

PostgreSQL integration

Run parameterized queries and insert, update, upsert, and delete rows in a client's PostgreSQL database from inside a workflow.

What it does

The PostgreSQL integration lets your agency read and write a client's PostgreSQL database directly from a workflow. Connect the database once with a connection string or discrete host, port, user, password, and database, and your workflows can run a parameterized query, insert a row, update or delete rows by an equality filter, and upsert a row on a conflict key. Connection details are encrypted at rest, every value you pass is bound as a parameter rather than spliced into the SQL, and results are capped so a large read cannot overwhelm a run.

Connect a PostgreSQL database

  1. Open your workspace in TaskJuice and add a PostgreSQL connection on the node that uses it.
  2. Paste a connection string, for example postgresql://user:password@db.example.com:5432/appdb?sslmode=verify-full. The TLS posture is read from the connection string; sslmode=verify-full validates the server certificate and hostname.
  3. Or fill in the host, port (5432 by default), user, password, and database separately. Discrete connections default to verifying the full certificate chain.
  4. Save the connection. The password and connection string are stored encrypted and are never shown again or written to run output.

Provision a least-privilege database user scoped to the tables the workflow touches, and expose the database on a public host the workflow can reach over TLS. Private and internal addresses are blocked.

Actions

  • postgresql/query runs a SQL statement with $1, $2, … placeholders and a matching params array, returning the result rows and the row count.
  • postgresql/insert inserts a row from a column-to-value map and returns the affected row count.
  • postgresql/update updates the rows matching an equality filter, setting new column values, and returns the affected row count.
  • postgresql/upsert inserts a row or, on a conflict with the columns you name, updates it (INSERT … ON CONFLICT DO UPDATE).
  • postgresql/delete deletes the rows matching an equality filter and returns the deleted row count.

Write a safe query

Always pass values through params, never by building the SQL string yourself:

sql:    SELECT id, email FROM customers WHERE status = $1 AND created_at > $2
params: ["active", "2026-01-01"]

Table and column names in the insert, update, upsert, and delete actions are validated against a strict allowlist and quoted for you, so a name containing a quote, semicolon, or whitespace is rejected before the statement runs.

Known limitations

  • The query action returns at most 1,000 rows and around 5 MB per call; when a read is clipped the result sets truncated to true so a workflow can detect it. Add a LIMIT and a WHERE clause to keep reads bounded.
  • A statement that runs longer than 30 seconds is cancelled by the database. Keep queries indexed and selective.
  • Connections are short-lived: each action opens and closes its own connection. Point the connection at a pooler (such as PgBouncer) if your database has a low connection limit.
  • Database triggers (reacting to new or changed rows) are not part of this integration; it provides read and write actions only.
Was this helpful?