Skip to main content
The Data Query step lets you execute a SQL query to fetch, filter, or transform your input data. Use this step to:
  • Enrich data: Join your input data with additional tables to add extra context.
  • Refetch information: Retrieve the most up-to-date data after a Wait step.
  • Filter rows: Apply custom conditions to include or exclude specific records.
  • Fan-out: Expand a single trigger event into multiple notifications by transforming the input row into multiple rows.
To add a Data Query step, click the ”+” placeholder node in the builder or the ”+” button on any connection between two steps, then select Data Query.
Data Query interface

Configuration of a Data Query step that enriches user data by joining with the organization table.

Breakdown

Select a database connection

Choose the database connection through which the query will be executed. This connection must be configured in your settings.

Write your SQL query

Enter a SQL statement that processes the data from the parent step. You can access the input data via a temporary table called input_rows in addition to the tables from the database connection you selected.The query editor supports SQL syntax highlighting, auto-completion, and a built-in formatter.
Suppose the parent step returns user details with columns like email and organization_id, and you want to bring in the user’s organization name for a notification template. You can write a query to join these rows with an organization table to enrich the data:
SELECT input_row.*,
      org.organization_name
FROM input_rows AS input_row
JOIN organization AS org
  ON input_row.organization_id = org.id;
In this query:
  • input_rows: Contains all data passed from the previous step.
  • organization: The table in your database that contains the organization name.

Add a description (optional)

Provide a brief description to easily identify this step within your workflow.

Test the query output

Use the Test Panel to preview outputs and validate your query. This ensures that the data passed on to subsequent steps meets your requirements.

Explore further