Actions3
Overview
This node allows you to insert rows into a PostgreSQL database table. It is useful when you want to add new records programmatically from workflows, such as importing data from other sources, automating data entry, or syncing information between systems.
For example, you could use this node to:
- Insert new customer records into a CRM database.
- Add transaction logs into a financial system.
- Populate a product catalog with new items from an external feed.
The node supports inserting multiple rows at once and offers different modes for executing queries (independently, multiple queries at once, or within a transaction).
Properties
| Name | Meaning |
|---|---|
| Schema | The name of the schema that contains the target table. Default is "public". |
| Table | The name of the table where new rows will be inserted. |
| Columns | Comma-separated list of properties to use as columns for the new rows. You can specify type casting using colons, e.g., id:int,name:text. |
| Return Fields | Comma-separated list of fields that the insert operation should return after execution. Default is * (all fields). |
| Additional Fields | A collection of optional settings: |
| - Mode | How queries are sent to the database: • Independently — each query runs separately. • Multiple Queries (default) — sends all queries at once. • Transaction — executes all queries in a single transaction. |
| - Output Large-Format Numbers As | Determines how large numeric values (NUMERIC, BIGINT) are returned: • Numbers • Text (recommended if numbers exceed 16 digits to avoid precision loss). |
Output
The node outputs JSON data representing the result of the insert operation. This typically includes the rows inserted, with the fields specified in the "Return Fields" property.
If large numeric types are present, their output format depends on the "Output Large-Format Numbers As" setting (either as JavaScript numbers or strings).
No binary data output is produced by this node.
Dependencies
- Requires a connection to a PostgreSQL database.
- Needs valid credentials including host, port, database name, user, and password.
- Supports SSL configuration options for secure connections.
- No additional external services are required beyond the PostgreSQL server.
Troubleshooting
- Connection errors: Ensure the database credentials and network access are correct. Check SSL settings if using encrypted connections.
- Invalid table or schema names: Verify that the specified schema and table exist in the database.
- Column mismatch: Make sure the columns listed match the properties in the input data and the database table structure.
- Large number precision issues: If numeric values longer than 16 digits are truncated or incorrect, switch the "Output Large-Format Numbers As" option to "Text".
- Query execution mode: Using "Transaction" mode will roll back all inserts if any fail; consider "Independently" mode if partial success is acceptable.