Database

Fetch Data

Category
Database
Node Type
Data Retrieval Node

Overview

The Fetch Data Node allows you to retrieve stored records (also called “documents”) from your database collection. You can fetch all records, a specific record, or simply count how many records exist — all without writing a single line of code.

This node is useful when your workflow needs to read, analyze, or display data that already exists in your database, such as user profiles, orders, or product lists.

Description

Retrieve data from your database.

The Fetch Data node connects your workflow to your chosen database collection and brings back the data you need. It supports three main retrieval modes:

Fetch All Documents

Retrieve every record inside a collection. Useful for lists and exports.

Fetch Specific Document

Retrieve a single record by its ID. Best for detailed views.

Count Documents

Get only the total number of records. Ideal for statistics and checks.

This node is perfect for displaying stored information, generating reports, or processing user data inside no-code workflows.

Input Parameters

The Fetch Data node accepts the following settings to define what data to retrieve.

Select Action TypestringRequired
Defines the fetch action: 'Fetch All Documents', 'Fetch Specific Document', or 'Count Documents'.
Example
"Fetch All Documents"
Collection NamestringRequired
The name of the collection (database) where your documents are stored. Format: 'environment:tableName'.
Example
"production:users"
Node DescriptionstringOptional
A short internal note describing what this node does in your workflow.
Example
"Fetch all active users"

Output Parameters

When executed, this node provides a structured JSON output that other nodes can use.

tableNamestringOptional
The full collection name.
Example
"production:users"
queryIdstringOptional
A unique ID generated for this fetch operation.
Example
"6e7b29a3-..."
dataarrayOptional
The array of documents fetched from the collection (present in Fetch All/Specific modes).
Example
[{"id": "1", "name": "Alice"}, ...]
countnumberOptional
The total number of records (present in Count mode).
Example
13
messagestringOptional
A success message describing the result.
Example
"Successfully fetched 3 documents"
statusstringOptional
Indicates the result of the operation.
Example
"success"
Accessing Data

Access the results in your workflow using:

{{fetch-data.output.data}}
{{fetch-data.output.count}}

Output Type

Output Type: JSON

The node output is in JSON format, meaning the data is structured into fields and values. This makes it easy for other workflow nodes to read, filter, or use the information directly.

Example Usage

Example 1: Fetch All Documents

Retrieve all user records.

{  "Select Action Type": "Fetch All Documents",  "Collection Name": "production:users"}
{  "tableName": "production:users",  "queryId": "6e7b29a3-...",  "data": [    {      "id": "201",      "name": "Alice Carter",      "active": "yes",      "created_at": "2024-11-05T09:00:00.000Z"    },    {      "id": "202",      "name": "Brian Thompson",      "active": "no",      "created_at": "2024-12-10T14:30:00.000Z"    }  ],  "message": "Successfully fetched 2 documents",  "status": "success"}

Example 2: Count Documents

Count total number of orders.

{  "Select Action Type": "Count Documents",  "Collection Name": "production:orders"}
{  "tableName": "production:orders",  "count": 150,  "message": "Successfully counted documents",  "status": "success"}

How to Use in a No-Code Workflow

1

Add the Node

Drag and drop the Fetch Data node into your workflow canvas.

2

Open Settings

Click on the node to open its configuration panel.

3

Select Action

Choose one of the three options: "Fetch All Documents", "Fetch Specific Document", or "Count Documents".

4

Choose Collection

Select your database collection such as production:users.

5

Run Workflow

Save changes and run the workflow. The node will fetch data and pass it to the next node.

Best Practices

  • Always verify that you are fetching from the correct collection.
  • Use Count Documents to check totals before performing actions like filtering or deleting.
  • If you only need specific records, use Fetch Specific Document to avoid unnecessary data load.

Do / Don’t

Do
  • ✔️ Use meaningful Node Descriptions.
  • ✔️ Combine with Filter nodes to refine "Fetch All" results.
  • ✔️ Handle empty data arrays gracefully in downstream nodes.
Don’t
  • ❌ Don’t fetch all documents from a massive table unless necessary (use Query Data with limit instead).
  • ❌ Don’t ignore the status field; check for errors.
  • ❌ Don’t confuse "Fetch All" with "Query Data" (Query allows server-side filtering).

Common Errors

Missing Collection NameErrorOptional
The node cannot run without selecting a valid collection.
Invalid Action TypeErrorOptional
Ensure one of the supported options is chosen.
Empty ResultsWarningOptional
Happens when no records exist in the selected collection.
Connection TimeoutErrorOptional
Check your database connection or permissions if data fails to load.

Example Workflow Integration

Use Case 1: Admin Dashboard

Display a list of all users.

  1. Trigger Node: Admin clicks "View Users".
  2. Fetch Data Node: Retrieves all user data from production:users.
  3. Display Node: Renders the user list in a table.

Workflow Data Flow:

{{fetchData.data}}    →  {{displayTable.input.rows}}

Use Case 2: Inventory Check

Check if products are in stock before processing an order.

  1. Fetch Data Node: Count documents in production:inventory.
  2. Logic Node: If count > 0, proceed to checkout; else, show "Out of Stock".

Workflow Data Flow:

{{fetchData.count}}   →  {{logicNode.input.value}}