How structured and unstructured data flows dynamically between tables and workflows in Rayven applications.
Overview
In Rayven, workflows act as the dynamic processing engine for your application, while tables are used to persist structured data. Data movement between these components is central to how Rayven applications operate—allowing records to be read, enriched, updated, or generated on demand.
This article explains how data moves between tables and workflows, how to read from and write to tables using workflow nodes, and how to chain workflows together for modular logic.
Moving Data Between Tables and Workflows
Rayven provides three primary methods to move data between tables and workflows:
Method | Description | Use Case |
---|---|---|
Query Table Node | Reads data from a Primary or Secondary Table into the workflow | Enrich a workflow with stored values |
Update Table Node | Writes data from a workflow into a Primary or Secondary Table | Create or update records from processed inputs |
UI Code Node (JavaScript) | Uses getDataFromTable function to fetch data directly |
Dynamic interaction from custom widgets or forms |
These methods give you flexibility to dynamically process and persist structured data as part of your logic flows.
Reading from Tables from Workflows
Rayven provides two methods for reading structured data from tables into workflows:
1. Query Table Node
Use the Query Table node to retrieve data from either a Primary or Secondary Table and bring it into your workflow's payload.
Key configuration options:
-
Node name: Label for the node
-
Output JSON keys: Where to store the result in the payload
-
From Table: Choose the table to query
-
Select Columns: Use
@
to select columns or inject dynamic values -
WHERE: Add filter conditions statically or dynamically
Dynamic queries using payload keys
You can populate the Select Columns and WHERE fields using dynamic keys from the incoming JSON payload. Use the ##key##
format:
Example input payload:
{
"columns_to_query": "product_uid,product_name,product_description,product_price,product_created_date",
"sql_query": "product_price > 100"
}
Dynamic Query Table configuration:
-
Select Columns:
##columns_to_query##
-
WHERE:
##sql_query##
This enables fully dynamic queries that adapt to the data passed into the workflow.
Example Use Cases:
-
Load product details when a quote is submitted
-
Fetch a user profile based on UID
-
Retrieve configuration data for calculations
2. UI Code Node – getDataFromTable()
Function
In custom widgets built using the UI Code node, you can fetch table data at runtime using the getDataFromTable()
JavaScript function.
getDataFromTable('table_Id', 'Return_Function_Name', 'Lookup_Name'(optional), 'Filter_By_Value'(optional), 'Row_Count'(optional));
Parameters:
-
table_Id
– ID of the Primary or Secondary Table -
Return_Function_Name
– Name of your JS callback function -
Lookup_Name
– (Optional) Lookup field name -
Filter_By_Value
– (Optional) Filter the query -
Row_Count
– (Optional) Limit number of rows returned
This method is ideal for interactive widgets like dropdown selectors or contextual sidebars.
Writing to Tables from Workflows
Rayven workflows can also write structured data back to Primary or Secondary Tables using the Update Table node.
Update Table Node
Use the Update Table node to save new rows or update existing ones in your structured tables. This operation does not return data from the table itself, but the node will output the data it wrote as part of the workflow payload—helpful for downstream confirmation or processing.
Key configuration options:
-
Node name: Identifier for the node
-
Select Table: Choose the Primary or Secondary Table
-
Write JSON key: The key in the payload whose value will be written
-
To Column: The table column to write to
-
Key: Optionally designate this as the Key Column (used to match existing rows)
The node's output JSON payload will reflect what was written, allowing you to log or pass that data along to another node.
Example Use Cases:
-
Save submitted form data to a Contacts table
-
Log a new Quote or Task record
-
Update the status of a row after processing
Iterative Workflow Execution Over Table Rows
Rayven workflows can be set to run:
-
Once per workflow execution (default)
-
For each row in the Primary Table
-
For each row matching a label filter
This is configured in Trigger or Connector nodes and is essential when applying logic to many records dynamically. This allows for record-by-record processing, useful for scheduled updates, automation over subsets, or alert generation.
Example:
A workflow might run every hour and process all customer records with a Status = Pending
label.
Passing Data Between Workflows
To modularise complex workflows, Rayven supports inter-workflow communication via the Send Data to Node:
-
Sends any received JSON payload from one workflow
-
Receives it in a target workflow via the nominated node
-
Allows chaining of logic across multiple workflows
Use cases:
-
Shared enrichment logic used by multiple workflows
-
Sending raw input to one workflow and delegating processing to another
Important Considerations
-
Workflows run independently from tables. Tables are persistent storage; workflows are logic engines.
-
Workflow data is unstructured and time-stamped. All workflow activity is stored in the Cassandra time series database, separate from the tables.
-
Table data must be actively pulled in or written to. Workflows only access table data when you explicitly use nodes to do so.
-
Inspect Data tab on every node helps trace what data is moving through and how it changes at each step.
Best Practices
-
Modularise logic: Keep read/write operations separate from transformation steps for clarity.
-
Use Inspect Data: Check node-level payloads frequently to understand how your data is flowing.
-
Validate writes: Ensure your Update Table writes map to valid Key Columns or UIDs.
-
Use the right tool: Prefer
Query Table
for processing table data through workflows,getDataFromTable()
for interactive widgets.
Summary
Rayven gives you flexible tools to move structured data between tables and workflows. Whether you're pulling records for decision logic, writing results after processing, or dynamically fetching values in a custom widget, you have three robust options:
-
Query Table: Workflow-based retrieval
-
Update Table: Workflow-based saving
-
getDataFromTable(): UI-based lookup in custom widgets
This separation of logic and storage helps maintain scalable, modular, and reliable apps.
FAQs
Can I read and write to both Primary and Secondary Tables?
Yes. Both Query Table and Update Table nodes support both table types.
Does the UI Code node require a query node to read from a table?
No. It can call getDataFromTable()
directly using JavaScript.
What happens if I try to update a row without a matching UID or Key Column?
A new row will be created automatically.
Can workflows write to multiple tables?
Yes. You can add multiple Update Table nodes in a single workflow to write to different tables.
Do workflows automatically read from or write to tables?
No. Workflows only interact with tables when you explicitly use the relevant nodes or JavaScript functions.
How can I loop through every row in a table in a workflow?
Configure the Trigger node to execute the workflow iteratively for each row in the Primary Table, optionally filtered by label values.
Is table data stored with time stamps?
No. Structured data in tables is not time-stamped. Time-series data from workflows is stored separately in the unstructured Cassandra database.
Can I pass data from one workflow to another?
Yes. Use the Send Data to Node node to transmit the received payload from one workflow to another.