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
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
$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
2. Retrieving Transactions Greater Than $500
3. Fetching Users Between Ages 25 and 40
How Each Configuration Works
Table
Specifies the Table to query.
Example:
Users
,Transactions
,LoanApplications
.
Filters (Optional)
Used to narrow down the data retrieval by applying conditions.
Example: Fetching users aged 25 or older
Projection (Optional)
Controls which fields should be included or excluded in the result.
Example: Only retrieving name and age, excluding
_id
:
Output Format
The result is always returned as an array of objects under the
"data"
key:
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:
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:
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:
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. 🚀
Last updated