LogoLogo
Documentation
Documentation
  • Getting Started
    • Introduction
    • Sign up to Developer Edition
    • Build Your First Agent
    • Developer Support
  • Core Concepts
    • Agent
      • Knowledge
      • Webhook
    • PII Masking
    • Sub-Agent
    • Intent
    • Workflow
      • Node
        • Input
        • Output
        • Loader
        • Display
        • API Node
        • Web Crawler
        • Table Write
        • Table Read
        • Ruleset
        • Upload Document
        • Javascript
        • Workflow
        • Loop
        • Document To Image
        • External Database
        • Storage Write
        • Storage Read
        • Fetch Document
        • Prompt
        • RAG Query
        • Vector Search
        • Emit Event
    • RAG
    • Model Hub
      • Entity Recognizers
    • Data Gateway
    • Rulesets
    • Code Snippets
    • Tables
    • Storage
    • Widget
  • Overview of GenAI
    • Introduction
    • Key concepts
      • Intent Classification
      • Inference
      • Generative AI Models
      • Large Language Models (LLMs)
      • Prompt Engineering
      • AI Agents
      • RAG (Retrieval Augmented Generation)
      • AI Workflow Automation
      • AI Agents vs LLM-based APPs
Powered by GitBook
On this page
  • Overview
  • Configurations
  • How Each Configuration Works
  • Example Use-Cases
  • Key Takeaways for Developers
Export as PDF
  1. Core Concepts
  2. Workflow
  3. Node

Table Read

Overview

The Table Read Node is the counterpart to the Table Write Node, allowing developers to retrieve data from a persistent table within the UPTIQ AI Workbench. This node is essential for workflows that require fetching stored records, applying filtering conditions, and selecting specific fields before processing further.

Unlike a traditional database query tool, this node enables structured data retrieval within AI-driven workflows, ensuring that the output can be dynamically used in subsequent nodes, such as AI processing, user responses, or workflow decision-making.

Configurations

Field
Description

Table

Select the table from which data will be retrieved.

Filters (Optional)

Define a JSON filter using NoSQL query syntax to apply conditions when querying data. Leave empty to fetch all records.

Projection (Optional)

Define which fields should be included or excluded in the output. Helps in optimizing data retrieval.

Filters (Optional) – Using NoSQL Query Syntax

The Table Read Node uses NoSQL-style filtering, similar to MongoDB query syntax, to retrieve specific records based on conditions. Filters must be structured as JSON objects with field names as keys and operators as values.

Common NoSQL Query Operators Supported

Operator
Description
Example

$eq

Matches an exact value.

{ "status": { "$eq": "approved" } }

$ne

Matches values not equal to the given value.

{ "status": { "$ne": "rejected" } }

$gt

Matches values greater than the given number.

{ "age": { "$gt": 30 } }

$gte

Matches values greater than or equal to the given number.

{ "age": { "$gte": 25 } }

$lt

Matches values less than the given number.

{ "loanAmount": { "$lt": 50000 } }

$lte

Matches values less than or equal to the given number.

{ "loanAmount": { "$lte": 100000 } }

$in

Matches values in a specified list.

{ "status": { "$in": ["pending", "under review"] } }

$nin

Matches values not in a specified list.

{ "status": { "$nin": ["rejected", "closed"] } }

Example Filter Configurations

1. Fetching Approved Loan Applications

{ "status": { "$eq": "approved" } }

2. Retrieving Transactions Greater Than $500

{ "amount": { "$gt": 500 } }

3. Fetching Users Between Ages 25 and 40

{ "age": { "$gte": 25, "$lte": 40 } }

How Each Configuration Works

  1. Table

    • Specifies the Table to query.

    • Example: Users, Transactions, LoanApplications.

  2. Filters (Optional)

    • Used to narrow down the data retrieval by applying conditions.

    • Example: Fetching users aged 25 or older

      { 
          "age": { "$gte": 25 } 
      }
  3. Projection (Optional)

    • Controls which fields should be included or excluded in the result.

    • Example: Only retrieving name and age, excluding _id:

      { 
          "name": 1, "age": 1, "_id": 0 
      }

Output Format

  • The result is always returned as an array of objects under the "data" key:

    { 
        "data": any[] 
    }

Example Use-Cases

1. Fetching Users Above a Certain Age

A workflow needs to retrieve users who are 25 years or older for a targeted AI campaign.

  • Configuration:

    • Table: Users

    • Filters: { "age": { "$gte": 25 } }

    • Projection: { "name": 1, "age": 1, "_id": 0 }

  • Output:

    jsonCopyEdit{
      "data": [
        { "name": "Alice", "age": 25 },
        { "name": "Bob", "age": 30 }
      ]
    }
  • How it's used: The workflow processes these users for personalized AI-driven recommendations.


2. Retrieving Pending Loan Applications

A financial agent needs to fetch all loan applications that are pending review.

  • Configuration:

    • Table: LoanApplications

    • Filters: { "status": "pending" }

    • Projection: { "applicantName": 1, "loanAmount": 1, "_id": 0 }

  • Output:

    jsonCopyEdit{
      "data": [
        { "applicantName": "John Doe", "loanAmount": 50000 },
        { "applicantName": "Jane Smith", "loanAmount": 75000 }
      ]
    }
  • How it's used: The agent can display this data in a summary table and trigger review workflows.


3. Fetching Recent Transactions for a User

A customer service workflow needs to fetch the latest 5 transactions for a user with ID "U12345".

  • Configuration:

    • Table: Transactions

    • Filters: { "userId": "U12345" }

    • Projection: { "transactionId": 1, "amount": 1, "status": 1, "_id": 0 }

  • Output:

    jsonCopyEdit{
      "data": [
        { "transactionId": "T001", "amount": 150, "status": "completed" },
        { "transactionId": "T002", "amount": 300, "status": "pending" }
      ]
    }
  • How it's used: This data is summarized and presented to the support agent during a live chat.

Key Takeaways for Developers

✅ Efficient Data Retrieval – Fetch only the necessary data using Filters and Projections, ensuring optimized workflow execution.

✅ Supports Complex Queries – Use JSON-based filtering for range-based, conditional, or status-specific data retrieval.

✅ Seamless Integration with AI Workflows – The output can be passed to AI nodes, summary nodes, or user interaction nodes for real-time decision-making.

✅ Structured JSON Output for Easy Processing – Always returns results in a standardized format, making it easy to consume by subsequent nodes.

By leveraging the Table Read Node, developers can extract meaningful insights from persistent storage, ensuring that AI agents, automation workflows, and business processes operate with real-time and structured data. 🚀

PreviousTable WriteNextRuleset

Last updated 3 months ago