Skip to main content

PostgreSQL Operations Reference

Orkes Conductor integrates with PostgreSQL to let you manage database tables and records directly from your workflows. Once you configure the PostgreSQL integration, you can use the following operations to create, retrieve, update, and delete data in PostgreSQL without leaving your workflow.

This page covers the parameters and expected output for each operation available in the PostgreSQL integration.

Create Table

Creates a new table in the PostgreSQL database with the specified columns and constraints.

ParameterDescriptionTypeRequired/Optional
Table NameThe name of the table to create.stringRequired.
Column DefinitionsThe column definitions for the table. Supported values:
  • JSON array (e.g., [{"name":"id","type":"SERIAL PRIMARY KEY"},{"name":"name","type":"VARCHAR(255) NOT NULL"}])
  • comma-separated string (e.g., id:SERIAL PRIMARY KEY,name:VARCHAR(255) NOT NULL)
stringRequired.

Delete Table

Deletes an existing table from the database.

ParameterDescriptionTypeRequired/Optional
Table NameThe name of the table to delete.stringRequired.

Insert Rows

Inserts one or more rows into a table.

ParameterDescriptionTypeRequired/Optional
Table NameThe name of the table to insert rows into.stringRequired.
ColumnsThe column names to insert data into. Supported formats:
  • JSON array (e.g., ["id","name","email"])
  • comma-separated string (e.g., "id,name,email")
stringRequired.
ValuesThe row values to insert. Supported formats:
  • JSON array of arrays for multiple rows (e.g., [[1,"John","john@example.com"],[2,"Jane","jane@example.com"]])
  • a single JSON array for one row (e.g., [1,"John","john@example.com"])
stringRequired.

Update Rows

Updates existing rows in a table.

ParameterDescriptionTypeRequired/Optional
Table NameThe name of the table that contains the rows to update.stringRequired.
Set ClauseThe column assignments to apply, in SET clause format (e.g., name = 'John', age = 30).stringRequired.
Where ClauseThe condition to filter rows to update, in WHERE clause format (e.g., id = 1). If not provided, all rows are updated.stringOptional.

Upsert Rows

Inserts rows or updates them if they already exist. Unlike Update Rows, Upsert Rows inserts the row if no matching record is found, making it suitable when you are unsure whether the record already exists.

ParameterDescriptionTypeRequired/Optional
Table NameThe name of the table to upsert rows into.stringRequired.
ColumnsThe column names to insert data into. Supported formats:
  • JSON array (e.g., ["id","name"])
  • comma-separated string (e.g., id,name)
stringRequired.
ValuesThe row values to insert. Supported formats:
  • JSON array of arrays for multiple rows (e.g., [[1,"John"],[2,"Jane"]])
  • a single JSON array for one row (e.g., [1,"John"])
stringRequired.
Conflict TargetThe column name(s) with a unique constraint used to detect duplicate rows. If a row with the same value already exists, it is updated instead of inserted (e.g., id or email).stringRequired.
Update ColumnsThe columns to update on conflict. Supported formats:
  • JSON array
  • comma-separated string
Defaults to all columns except the conflict target.
stringOptional.

Select Rows

Retrieves rows from a table based on specified conditions.

ParameterDescriptionTypeRequired/Optional
Table NameThe name of the table to retrieve rows from.stringRequired.
ColumnsThe column names to retrieve. Supported formats: JSON array (e.g., ["id","name"]) or comma-separated string (e.g., id,name). Defaults to all columns (*).stringOptional.
Where ClauseThe condition to filter rows, in WHERE clause format (e.g., id > 100 AND status = 'active'). If not provided, all rows are returned.stringOptional.
Order ByThe column(s) to sort the results by, in ORDER BY clause format (e.g., id DESC).stringOptional.
LimitThe maximum number of rows to return.integerOptional.

Delete Rows

Deletes rows from a table based on specified conditions.

ParameterDescriptionTypeRequired/Optional
Table NameThe name of the table to delete rows from.stringRequired.
Where ClauseThe condition to filter rows to delete, in WHERE clause format (e.g., id = 1). If not provided, all rows are deleted.stringOptional.

Execute SQL

Executes a raw SQL query against the database.

ParameterDescriptionTypeRequired/Optional
SQL QueryThe SQL query to execute (e.g., SELECT * FROM users WHERE id = 1).stringRequired.