Table of Content
Still need help?
Request support
Request Support
Help
 / 
 / 
Workflows
 / 

Workflows: Database Workflow Node

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.

Select Database Type

Use Cases

  • Notification Workflow: Retrieve customer data like name and email, and send personalized notifications.
  • Inventory Management: Fetch current stock levels from the database and use them in workflows to generate alerts or orders.
  • Employee Updates: Pull specific employee details (e.g., department or designation) for HR workflows.
  • Report Generation: Retrieve data for generating and emailing summary reports.

Adding the Database Workflow Node

To include the Database Workflow Node in your workflow, click on ‘Add step’ or the ‘+’ symbol and select the node from the list.

Editing the Node

Click on the Database Workflow Node to configure the following fields in the right panel.

 Database Type

Step Name

The Step Name is used to identify the workflow node.

Example: Fetch Customer Data or Retrieve Inventory.

Select Database Type

Select Database Type

Choose the type of database you want to connect to from the dropdown menu.

Supported Options: MySQL, PostgreSQL, AzureSQL.

database

Database Host

Enter the hostname or IP address of your database server.

Example: database.company.com or 192.168.1.1.

Port

Specify the port number for your database connection.

Example: 3306 for MySQL or 5432 for PostgreSQL.

Username and Password

Provide the credentials for accessing the database. Ensure this account has read permissions for the required tables.

Database Name

Enter the exact name of the database where your data resides.

Example: employee_table.

Authenticate

Click on Authenticate to establish a connection with the database. Once authenticated, additional fields will appear for query configuration.

Query Configuration

Query Configuration

Once the connection is authenticated, configure the query and output fields to fetch the required data.

Database Query

Write an SQL query to fetch the desired data.

  • Example: SELECT * FROM employee_table;
  • Note: Use queries with filters to avoid fetching unnecessary data.

Output Fields

Output Fields

Define the column names from your database query as output fields.

  • These must match the column names exactly as they appear in the database.
  • Only the columns specified here will be fetched and available for further workflow nodes.

Example:

If your query is:

SELECT * FROM employee_table;

And your output fields are set as:

  • age
  • email

Only these two fields will be fetched and available for subsequent steps.

Using Output Fields in Other Workflow Nodes

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.

Example:
Example

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:

  1. {database#item_age}: Contains the age of the employee.
  2. {database#item_email}: Contains the email of the employee.

Using in Email Workflow Node:

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.

Other Options

Parent Step

Define the parent step for the node. This ensures the node is executed only after its parent step completes.

Enable This Step

Toggle this option to enable or disable the workflow step. Disabling a step skips its execution during the workflow.

FAQs
Try our free plan
It will answer many more questions within just 15 minutes.