Skip to content

Create Records (Relational DB) v1.0.2 Help

Creates new records in a relational database table.

How can I use the Step?

The Step lets you manage relational databases in the Relational DB service. You can use the Step in a workflow for various use cases such as data entry, record keeping, and report generation.

How does the Step work?

You specify the database table and provide the object to construct the SQL query. The Step takes these inputs to execute an SQL INSERT INTO statement against the selected table.

Prerequisites

Before you get started, make sure to meet the following conditions:

  • The Step requires a database table in the Relational DB service.
  • If you want to use an external database, connect it to the Relational DB service first.

How to connect an external database?

To connect an external database to our Relational DB service, follow these steps:

  1. Go to Data > Relational DB and click +Create database.

  2. In the modal window, select the Connect external database checkbox, and enter the following details:

    • Name: Database name. Ensure it matches the name of the external database you want to connect.
    • Host: Machine or server of the external database location.
    • Port: Network port number to establish the connection.
    • Username: User name to authenticate the user.
    • Password: Password to authenticate the user and grant them access to the database.
  3. Click Create. If the connection is successful, the external database appears in the list of all databases in your account.

Database settings

To set up the section, specify the database, schema, and table you want to use:

  • For Database, select a database name from the list provided by the Relational DB service or input one using the Merge field. If you use the Merge field, the options to choose an internal or an external database appear - make sure to select an appropriate one.
  • For Schema, select the schema name containing the table.
  • For Table, select the table name where you want to insert new record(s).

Query settings

The Step uses JSON objects to construct an SQL query: keys correspond to the table fields (columns), and values form the table record (row).

To set up the section, follow these steps:

  1. Specify the object(s) using one of the following tabs. If set both tabs, the Step only applies configuration from the active one:

    • For Build an object, add the key-value pairs to build a JSON object. You can only create a single record with this option.
    • For Select a variable, complete the Name field using the Merge field variable. You can provide an object to create a single record or an array of objects to create multiple records. The array of objects has no size limit, but the Flow execution timeout is applied (30 seconds by default).
  2. Optional: Enable Log query to add query information to the session log.

Merge field settings

The Step returns the result as a JSON object and stores it in the Merge field variable. So you can use the retrieved data in subsequent Steps or other Flows.

Output example

The output JSON object contains information about the number of records (rows) that the Step has inserted into the table. For example:

json
{
    "rowCount": 1
}
{
    "rowCount": 1
}

Error handling

By default, the Handle error toggle is on, and the Step handles errors with a separate exit. If any error occurs during the Step execution, the Flow proceeds down the error exit.

If the Handle error toggle is disabled, the Step does not handle errors. In this case, if any error occurs during the Step execution, the Flow fails immediately after exceeding the Flow timeout. To prevent the Flow from being suspended and continue handling errors, you can place the Flow Error Handling Step before the main logic or your Flow.

Reporting

After the Step completes, it generates a report that includes its execution status and other details. You can customize the report by adjusting the Step's log level and adding tags.

Log level

By default, the Step's log level matches that of the Flow. You can change the Step's log level by selecting an appropriate option from the Log level dropdown.

Tags

Tags provide a way to classify and search for sessions based on their attributes. To create a new tag, specify its category, label, and value. You can then use tags to filter and group the sessions in the report.

Service dependencies

  • flow builder v2.34.0
  • postgresql v2.4.0

Release notes

v1.0.2

  • Add an external database selection for Database

v1.0.0

  • Initial release