Query Data
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"Query Data"tableNamestringRequired"production:users"Query FieldsarrayOptional[{"field": "status", "operator": "=", "value": "active"}]naturalLanguagestringOptional"Find users with gmail emails"queryCombinationTypestringOptional"AND"orderBystringOptional"created_at"orderDirectionstringOptional"Descending"limitnumberOptional50offsetnumberOptional0Dynamic 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"production:users"queryIdstringOptional"a5aeb97e-..."dataarrayOptional[{"id": "1", "name": "Alice"}, ...]messagestringOptional"Successfully fetched 13 documents"statusstringOptional"success"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
Add the Node
Drag and drop the Query Data node into your workflow.
Choose Query Type
Select "Query Data" for structured filters or "Natural Language Query" for plain text instructions.
Select Table
Pick your Table Name (e.g., production:users).
Define Filters
If using structured query, click Add Field and set up conditions (Field, Operator, Value). Combine with "AND" or "OR".
Set Options
Choose sorting (orderBy), limit, and offset if needed.
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
- ✔️ Use unique fields like
idwhen querying for a single specific record. - ✔️ Double-check Natural Language queries to ensure the AI interprets them correctly.
- ✔️ Use
offsetfor pagination when displaying large lists.
- ❌ Don’t fetch all records without a limit from a large table.
- ❌ Don’t mix up
ANDandORlogic; keep it simple or break into steps. - ❌ Don’t assume the order of results unless you specify
orderBy.
Common Errors
Empty resultsWarningOptionalInvalid table nameErrorOptionalMissing required fieldErrorOptionalSorting not workingErrorOptionalExample Workflow Integration
Use Case 1: Search Dashboard
Allow users to search for products.
- Form Input: User types a search term (e.g., "headphones").
- Query Data Node: Search
production:productswherenamecontains input. - 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.
- Schedule Trigger: Runs every morning at 8 AM.
- Query Data Node: Fetch
production:orderscreated in the last 24 hours. - Generate Text Node: Summarize the sales data.
- Email Node: Send the summary to the manager.
Workflow Data Flow:
{{schedule.yesterday}} → {{queryData.filters.created_after}}
{{queryData.data}} → {{aiSummary.input.data}}
