Database

Query Data

Category
Database
Node Type
Read / Query Node

Overview

The Query Data Node allows you to search, filter, and retrieve records from your connected database collection within a no-code workflow. It enables you to fetch specific rows based on filters, get all data, or even use plain language to describe what you want to retrieve — no SQL required.

Description

Search and retrieve data from your database.

Use this node to connect to your selected database table (or collection) and return matching records as structured JSON. You can apply multiple filters, combine them with AND/OR logic, sort the data, limit how many records you want, and even paginate large data sets.

Structured Query

Build precise queries using fields, operators (e.g., =, contains), and values. Best for specific logic.

Natural Language Query

Type a plain-text instruction like "Find all active users created after January 2024". Best for quick, intuitive searches.

The output from this node can be passed to other nodes like "Display Data," "Generate Text," or "Create Chart."

Input Parameters

The Query Data node accepts various settings to define your search criteria.

selectQueryTypestringRequired
Choose between 'Query Data' (structured) or 'Natural Language Query'.
Example
"Query Data"
tableNamestringRequired
The table or collection to query. Format: 'environment:tableName'.
Example
"production:users"
Query FieldsarrayOptional
List of filters (Field, Operator, Value) for structured queries.
Example
[{"field": "status", "operator": "=", "value": "active"}]
naturalLanguagestringOptional
Plain text query instruction. Required if Query Type is 'Natural Language Query'.
Example
"Find users with gmail emails"
queryCombinationTypestringOptional
How to join multiple filters: 'AND' (all match) or 'OR' (any match).
Example
"AND"
orderBystringOptional
Field to sort results by.
Example
"created_at"
orderDirectionstringOptional
Sort direction: 'Ascending' or 'Descending'.
Example
"Descending"
limitnumberOptional
Maximum number of records to retrieve.
Example
50
offsetnumberOptional
Number of records to skip (for pagination).
Example
0
Instructions

Dynamic Values: You can use variables from previous nodes in your filter values:

Field: email
Operator: =
Value: {{form.email}}

Output Parameters

The node returns a structured JSON object containing the query results.

tableNamestringOptional
The full name of the collection that was queried.
Example
"production:users"
queryIdstringOptional
A unique ID automatically assigned to this specific query run.
Example
"a5aeb97e-..."
dataarrayOptional
The main output — a list of records returned by the query.
Example
[{"id": "1", "name": "Alice"}, ...]
messagestringOptional
A readable message summarizing the result.
Example
"Successfully fetched 13 documents"
statusstringOptional
Indicates success or failure of the operation.
Example
"success"
Accessing Data

Access the results array in your workflow using:

{{query-data.output.data}}

To access a specific field of the first result:

{{query-data.output.data[0].email}}

Output Type

Output Type: JSON

The output is returned in JSON format. The key data holds an array of record objects. This JSON can easily be passed to other nodes for further processing.

Example Usage

Example 1: Structured Query

Find active users, sorted by name.

{  "selectQueryType": "Query Data",  "tableName": "production:users",  "queryCombinationType": "AND",  "Query Fields": [    { "field": "active", "operator": "=", "value": "yes" }  ],  "orderBy": "name",  "orderDirection": "Ascending",  "limit": 50}
{  "tableName": "production:users",  "queryId": "a5aeb97e-...",  "data": [    {      "id": "10",      "name": "Amanda Taylor",      "active": "yes",      "email": "amanda@example.com"    },    {      "id": "5",      "name": "David Wilson",      "active": "yes",      "email": "david@example.com"    }  ],  "message": "Successfully fetched 2 documents",  "status": "success"}

Example 2: Natural Language Query

Find recent orders using plain English.

{  "selectQueryType": "Natural Language Query",  "tableName": "production:orders",  "naturalLanguage": "Find all orders created after January 2024 with amount greater than 100",  "limit": 20}
{  "tableName": "production:orders",  "queryId": "b12c98fa-...",  "data": [    {      "id": "ORD-101",      "amount": 150,      "created_at": "2024-02-15T10:00:00Z"    }  ],  "message": "Successfully fetched 1 documents",  "status": "success"}

How to Use in a No-Code Workflow

1

Add the Node

Drag and drop the Query Data node into your workflow.

2

Choose Query Type

Select "Query Data" for structured filters or "Natural Language Query" for plain text instructions.

3

Select Table

Pick your Table Name (e.g., production:users).

4

Define Filters

If using structured query, click Add Field and set up conditions (Field, Operator, Value). Combine with "AND" or "OR".

5

Set Options

Choose sorting (orderBy), limit, and offset if needed.

6

Run Workflow

Save and run. Connect the output to a display or processing node.

Best Practices

  • Always use a limit to avoid pulling huge datasets which can slow down your workflow.
  • Use consistent date formats (ISO format: YYYY-MM-DDTHH:mm:ss.sssZ) for reliable filtering.
  • Keep your queryId for debugging or workflow tracking.

Do / Don’t

Do
  • ✔️ Use unique fields like id when querying for a single specific record.
  • ✔️ Double-check Natural Language queries to ensure the AI interprets them correctly.
  • ✔️ Use offset for pagination when displaying large lists.
Don’t
  • ❌ Don’t fetch all records without a limit from a large table.
  • ❌ Don’t mix up AND and OR logic; keep it simple or break into steps.
  • ❌ Don’t assume the order of results unless you specify orderBy.

Common Errors

Empty resultsWarningOptional
Filters matched no records. Try loosening conditions.
Invalid table nameErrorOptional
Incorrect table or environment selected. Verify selection.
Missing required fieldErrorOptional
A necessary input or connection is missing.
Sorting not workingErrorOptional
The 'orderBy' field might be missing or have an inconsistent type.

Example Workflow Integration

Use Case 1: Search Dashboard

Allow users to search for products.

  1. Form Input: User types a search term (e.g., "headphones").
  2. Query Data Node: Search production:products where name contains input.
  3. Display Node: Show the list of matching products.

Workflow Data Flow:

{{form.searchTerm}}   →  {{queryData.filters.name_contains}}
{{queryData.data}}    →  {{displayNode.input.items}}

Use Case 2: Daily Report

Email a summary of yesterday's sales.

  1. Schedule Trigger: Runs every morning at 8 AM.
  2. Query Data Node: Fetch production:orders created in the last 24 hours.
  3. Generate Text Node: Summarize the sales data.
  4. Email Node: Send the summary to the manager.

Workflow Data Flow:

{{schedule.yesterday}} →  {{queryData.filters.created_after}}
{{queryData.data}}     →  {{aiSummary.input.data}}