1. Home
  2. 5: Automation & Workflows
  3. Input Protocol + IoT Connector Nodes

Query Tables Node Configuration Guide

The Query Tables Node allows workflows to retrieve structured data from Rayven’s Primary or Secondary Tables. This is typically used to enrich workflow logic with contextual or historical information stored in your tables.




Step-by-Step: How to Configure the Query Tables Node

  1. Add the node to your workflow
    Drag the “Query Tables” node into the workflow canvas.

  2. Set a Node Name
    Choose a name that clearly describes what the query does (e.g., GetDeviceSettings).

  3. Select the Table to Query
    Use the From Table dropdown to choose the Primary or Secondary Table you want to read data from.

  4. Choose the Output JSON Key
    This is the key under which the query results will be saved in the payload (e.g., "deviceSettings").

  5. Select the Columns to Retrieve

    • Use the Select Columns field to define which columns to return.

    • You can use @ to see available column names.

    • For example, select DeviceName, Threshold, Status.

  6. Define WHERE Conditions (optional)

    • Use the WHERE field to filter rows.

    • Example: @deviceId == "ABC123" or @status == "active" && @city == "Sydney".

  7. Save and test
    Connect the node, test it with sample payloads, and debug to inspect returned data under the configured key.



Basic Settings

Field Description
Node Name* A custom label for identifying this node within your workflow.
Output JSON Keys The key name used to store the results in the output payload.
 

 Table Selection

Field Description
From Table The table from which the query will retrieve data. Supports both Primary and Secondary tables.
Select Table Alternate field for specifying the same target table. Either option can be used depending on UI version.
 

Column Selection

Field Description
Select Columns Choose which columns you want to return in the query result.
Use @ to reference columns Use the @ symbol in logic expressions to access table fields, e.g., @temperature.
 

Filter Conditions

Field Description
WHERE Add logical filters to retrieve only the data that meets specific conditions.
Condition Define the rules to apply (e.g., @deviceId == 'ABC123' && @status == 'active').
 
  • You can use multiple logical conditions joined with && or ||.

  • Date and number-based comparisons are supported
    (e.g., @readingTime >= '2025-01-01').


Best Practices

  • Use specific columns instead of SELECT * to improve performance.

  • Use indexed fields (like UID or timestamp) in WHERE conditions for faster results.

  • If querying large tables, apply filters early to reduce memory overhead.


Frequently Asked Questions (FAQ)

Q: Can I query multiple tables at once?

A: No, the Query Tables Node queries one table per node. To query multiple tables, use multiple Query Tables Nodes and merge data downstream.

Q: What happens if no rows match the WHERE condition?

A: The output JSON will contain an empty array under the specified key.

Q: Can I use dynamic values in conditions?

A: Yes, you can reference incoming payload values using @payload.keyName in condition expressions.

Q: How do I reference a nested value in a condition?

A: Use dot notation like @payload.device.status == 'active'.