Skip to content
Postgres

How to use Postgres

DevelopersCost: 1 credit per runTop 100 · #38Full guide

What it is for

The Postgres component connects flooows to your PostgreSQL database to insert, find, update or delete rows and run SQL queries. It is used to sync data between apps, feed reports or store the results of automated processes.

New Row checks the table periodically, every few minutes, and detects new rows using the column chosen in "Order By Column" (for example, an incremental id or a created-at timestamp).

Set up the connection

Authentication type: Custom credentials

  1. 1Gather the connection details: host, port (usually 5432), user, password and database name.
  2. 2Make sure the server accepts external connections from flooows (firewall or IP allowlist).
  3. 3Add a Postgres step, click "Connect" and fill "Host", "Port", "User", "Password" and "Database".
  4. 4If your provider requires encryption, enable "Enable SSL" and, if needed, "Verify Server Certificate", pasting the certificate into "Certificate".
  5. 5Save the connection.
Connection fieldTypeRequired
HostTextYes
PortNumberYes
UserTextYes
PasswordSecret keyYes
DatabaseTextYes
Enable SSLYes / NoYes
Verify Server CertificateYes / NoYes
CertificateLong textNo

Credentials are stored encrypted in your isolated database, in Spain, and are never shown in plain text.

How to use it in a flow

  • Insert Row: pick the "Table" and map each column in "Values" with data from earlier steps; enable "Return Inserted Row" to get the generated id.
  • Find Rows: write something like email = $1 in "Condition" and pass the value in "Arguments" to avoid SQL injection.
  • Update Row and Delete Row use "Search Column" and "Search Value" to locate the affected rows.
  • Run Query allows free SQL with parameters in "Arguments" and a "Query Timeout".

Tips

  • •Create a dedicated database user with minimal permissions for flooows.
  • •Always use parameters instead of concatenating values into SQL.

Triggers (1)

Events that can start a flow. Expand each one to see its fields.

New RowPeriodic check3 fields
FieldTypeRequired
TableList (from your account)Yes
Order By ColumnList (from your account)Yes
Order DirectionFixed listYes

Actions (7)

Operations available as flow steps. Expand each one to see its fields.

Find Rows5 fields
FieldTypeRequired
TableList (from your account)Yes
ConditionTextNo
ArgumentsList of valuesNo
ColumnsMulti-selectNo
LimitNumberNo
Insert Row3 fields
FieldTypeRequired
TableList (from your account)Yes
ValuesKey / value pairsYes
Return Inserted RowYes / NoNo
Insert Multiple Rows4 fields
FieldTypeRequired
TableList (from your account)Yes
RowsDynamic fieldsYes
Keep Empty StringsYes / NoNo
Return Inserted RowsYes / NoNo
Update Row5 fields
FieldTypeRequired
TableList (from your account)Yes
ValuesKey / value pairsYes
Search ColumnList (from your account)Yes
Search ValueTextYes
Return Updated RowsYes / NoNo
Delete Row4 fields
FieldTypeRequired
TableList (from your account)Yes
Search ColumnList (from your account)Yes
Search ValueTextYes
Return Deleted RowsYes / NoNo
Get Tables0 fields

No fields to configure.

Run Query5 fields
FieldTypeRequired
QueryTextYes
ArgumentsList of valuesNo
Query TimeoutNumberNo
Connection TimeoutNumberNo
Application NameTextNo

Common errors

Connection timeout or ECONNREFUSED

Check host, port and that the firewall allows the connection.

password authentication failed

Verify user and password and save the connection again.

SSL or certificate error

Enable "Enable SSL", or turn off verification only if your provider allows it.

permission denied for table

Grant the user SELECT/INSERT/UPDATE on the table.

Field types

"List (from your account)" loads options from your connected account; "Dynamic fields" appear depending on earlier choices; in any field you can insert data from previous steps with the data selector (e.g. {{trigger.email}}). More about data between steps