This article explains the features and configurations of the Database Workflow Node, which allows you to fetch data dynamically from an external database and use the results within your workflows.
To include the Database Workflow Node in your workflow, click on ‘Add step’ or the ‘+’ symbol and select the node from the list.
Click on the Database Workflow Node to configure the following fields in the right panel.
The Step Name is used to identify the workflow node.
Example: Fetch Customer Data or Retrieve Inventory.
Choose the type of database you want to connect to from the dropdown menu.
Supported Options: MySQL, PostgreSQL, AzureSQL.
Enter the hostname or IP address of your database server.
Example: database.company.com or 192.168.1.1.
Specify the port number for your database connection.
Example: 3306 for MySQL or 5432 for PostgreSQL.
Provide the credentials for accessing the database. Ensure this account has read permissions for the required tables.
Enter the exact name of the database where your data resides.
Example: employee_table.
Click on Authenticate to establish a connection with the database. Once authenticated, additional fields will appear for query configuration.
Once the connection is authenticated, configure the query and output fields to fetch the required data.
Write an SQL query to fetch the desired data.
Define the column names from your database query as output fields.
Example:
If your query is:
SELECT * FROM employee_table;
And your output fields are set as:
Only these two fields will be fetched and available for subsequent steps.
Once the Database Workflow Node executes, output variables are generated based on the defined output fields. These variables can be used in subsequent nodes, such as Email Workflow Node, Approval Node, IF Node, etc.
To pull up any of the output variables from the Database workflow node, type in @ followed by the name of the node (if you haven’t changed the name, it will be database). You will see the output labels. Select the ones needed to pull up the output dynamically.
Database Query:
SELECT * FROM employe_table WHERE employee_name = ‘{name}’;
Output Fields: age, email.
Here, employee_name is a column in the database table and {name} is a field in the Clappia app to capture the name of an employee.
Generated Variables which can be pulled by typing in @ followed by the workflow node name:
Using in Email Workflow Node:
Subject: Employee Update
Body:
Hello,
This is Employee Age: {database#item_age}
Employee Email: {database#item_email}
This email will dynamically fetch the age and email for the employee retrieved in the query.
Define the parent step for the node. This ensures the node is executed only after its parent step completes.
Toggle this option to enable or disable the workflow step. Disabling a step skips its execution during the workflow.
L374, 1st Floor, 5th Main Rd, Sector 6, HSR Layout, Bengaluru, Karnataka 560102, India
3500 S DuPont Hwy, Dover,
Kent 19901, Delaware, USA
3500 S DuPont Hwy, Dover,
Kent 19901, Delaware, USA
L374, 1st Floor, 5th Main Rd, Sector 6, HSR Layout, Bengaluru, Karnataka 560102, India