Logic Nodes Reference
Every logic/ETL node for transforming, filtering, and aggregating workflow data.
These are the nodes under the Workflow editor's Logic & ETL palette. They sit in the middle of a workflow, between an input and an output/control node, transforming, filtering, aggregating, or routing the payload before it's delivered somewhere. See Connector Nodes Reference and Output Nodes Reference for the nodes on either end.
Associate or Split Payload NodeLogic
Extracts a device UID from an incoming JSON payload and maps it to the matching Rayven device, and/or splits an array within the payload into separate payloads for downstream processing. It can also stamp payloads with a timestamp taken from the incoming data.
How to configure it:
- Drag the "Associate or Split Payload" node onto the canvas and set the required Node Name.
- Set the required Incoming UID JSON key (the path to the identifier). For compound strings, add a Delimiter and Index (starts at 0).
- Optionally toggle "Use incoming UID + extracted string" and/or "Use JSON Key as UID" to control UID assignment (both off by default).
- Under Split Array, optionally set the Array JSON key, "Filter by JSON key (within the array object)", and Filter value.
- "Single payload per matching object" is on by default; set the Interval Between Output Payloads in milliseconds (default 500) to control output.
- Optionally enable "Store data for Node Export capability" if you need Node Export downstream.
- Under Associate Payload with Timestamp from JSON, optionally set the Timestamp JSON key, Timestamp format, and Time zone.
Function NodeLogic
Also known as the Advanced Function Node, this runs custom calculations, logic, string operations, or lookups against payload fields using a formula expression, and writes the result to a new payload key.
How to configure it:
- Drag the Advanced Function Node from the Logic & ETL group.
- Set the required Node Name.
- Optionally set the Output JSON Key for the result.
- Optionally use Formula Templates / Choose Formula to start from a prebuilt expression.
- Write the required expression in the Function field. This supports field references; time-based and aggregation lookups across device groups; custom table operations (aggregate, lookup, retrieve); logic functions (IF, IN); math functions (ABS, ROUND, SQRT, POW, trig functions); and date/time functions (DATEADD, DATEPART, TOUNIXTIME).
- Optionally set Decimal Places.
- Choose the required Error Handling Action (e.g. "Continue - Add Error to JSON").
- "Output zero if value not found" is on by default.
Conditional Filter NodeLogic
Evaluates a payload against a JSON key and an optional condition, only letting it continue downstream if it passes. Use this for branching logic, with optional rate-limiting.
How to configure it:
- Drag the node from the Logic & ETL category.
- Set the required Node Name.
- Enter the required JSON key to inspect (dot notation is supported).
- Independently toggle "Payload passes if JSON key exists" and/or "Payload passes if JSON key is absent" as needed (both off by default).
- Optionally set a Condition (equals, not equals, greater than, less than, contains, starts with) and a Value.
- Optionally set "Payload passes once in time period" and the Time Period Units (seconds, minutes, hours, or days) for rate-limiting.
Calculate Value for UID NodeLogic
Aggregates a numeric payload field over a rolling time window, per unique device (UID), for example, rolling flow-rate totals or energy consumption per device. Currently only the Sum calculation is supported.
How to configure it:
- Set the required Node Name.
- Enter the required JSON key to aggregate.
- Choose the required Calculation type (Sum only, currently).
- Set the required Calculation time span (a number) and the required Calculation time span units (Seconds, Minutes, Hours, or Days).
- Leave Calculation ends at "Up to current timestamp".
- Optionally set the Output JSON key.
- Optionally set How many up (typically 1) and Decimal places (default 2).
JavaScript NodeLogic
Runs custom JavaScript against each incoming payload for conditional logic, restructuring, unit or format conversions, and similar tasks.
How to configure it:
- Set the required Node Name.
- Optionally pick from JavaScript Templates, 15+ prebuilt snippets, including Base64-to-Hex, binary-to-decimal, Joules-to-kWh, geospatial distance, power factor, and array/field manipulation.
- Alternatively, describe what you want under "Describe what you want; AI will write the JavaScript" and click Next to generate a starting point into the AI-generated JavaScript panel.
- Optionally enable Add Device ID to automatically add payload.deviceId.
- Add an optional Description.
- Write the script in the Active JavaScript editor, which starts with a boilerplate comment header (Node Name, Behavior, Input, Output, Author, Copyright, Licensed under) and a parse/stringify skeleton: parse the input with JSON.parse(input), perform the logic, and assign the final output to the result variable using JSON.stringify(), this is required for downstream nodes.
- Choose the required Error handling action: "Continue – Add Error to JSON", "Continue – Ignore Error", or "Stop – Log error".
Built-in helper functions
GetDataFromTable(tableName, lookupFieldName, filterFieldValue, rowCount), reads rows from a custom Table as a JSON string. A rowCount of -1 returns all rows.var dataJson = GetDataFromTable("Devices Table", "device_code", "ABC123", 100);GetDataFromAPINode(apiNodeId, startDate, endDate), reads time-series/log data from Cassandra for a node ID across all devices. Dates are optional and use the format yyyy-MM-dd.var apiDataJson = GetDataFromAPINode("181739", "2025-05-15", "2025-05-26");PushPayload(valueToSend, type, typeValue, eventTimeMilliseconds), injects a JSON payload into a flow node, triggering execution for the targeted device(s). The type parameter is "default" (project default device), "UID" (a specific device via typeValue), "labelName" (all devices with a non-empty value in that column), or "labelValue" (format "name=value"). Use -1 for eventTimeMilliseconds to let the system pick the time. Returns "OK", "Node Not Found", or "Node Not Belong To Current Project".var status = PushPayload("{\"command\":\"restart\"}", "default", "", -1);ReadListingsFromFTP(path), lists the files and folders at a path on the project's FTP, returning objects like{ "Name": "file.txt", "ObjectType": "File" }.GetURLForFTPFile(fileName), generates a shareable URL for a named file on the project's FTP (uses credentials configured under App Settings → White Labelling → FTP Settings).
await, which is not supported in the JavaScript Node and causes an error. They are different from the similarly-named camelCase, callback-based functions available in the Interface Builder's Code tab, which are documented separately on the Interface Builder JS Functions reference page.Count Value by Time NodeLogic
Counts how many times a specified value occurs in incoming payloads within a rolling time window, optionally filtering by a condition and aggregating across multiple sources.
How to configure it:
- Drag the node from the Logic panel and connect your upstream sources.
- Set the Node Name.
- Set the Count Field.
- Set the Timeframe (in seconds).
- Optionally set a Filter Field (for example, "status") to only count matching events.
- Set the Data Output Field (for example, "event_count").
- Set the Logical Operand (AND/OR).
- Set the Select Data Source Filter.
Combine Data NodeLogic
Merges JSON payloads from multiple upstream nodes into a single combined output, supporting per-device merging via UID scoping.
How to configure it:
- Drag the node onto the canvas and connect the upstream source nodes you want to merge.
- Set the required Node Name.
- Optionally specify which upstream node(s) supply data in Hold Data from Node ID(s).
- Optionally enable Append Received Payloads to keep the full list instead of only the latest.
- Optionally enable Backfill to combine the current payload with the most recent values from the listed nodes, even if not all of them delivered data this cycle.
- Optionally choose the Payload Combine Method (e.g. "Combine Latest Received").
- Choose the required Error Handling Action (e.g. "Continue – Add Error to JSON").
- Optionally set Apply To (e.g. UID) to scope the merge per device.
Inspect Data NodeLogic
Lets you preview recent data for a device UID directly from the workflow editor, for debugging.
How to configure it:
- Set the required Node Name.
- Optionally choose a UID Name and set the Number of Results (default 100).
- Click Show to preview the matching data.
Extract JSON Key and Value from String NodeLogic
Splits a delimited string (for example, a comma-separated list) and pulls the value at a given index into a new JSON key, optionally deriving the output key name dynamically too.
How to configure it:
- Drag the node from the Logic panel and connect it to a node that outputs the string to parse.
- Set the required Node Name.
- Under Extract Value from String, optionally set the JSON Key Containing String of Values (the source field), set the required Delimiter and required Index (starts at 0), and optionally set a New Output JSON Key for the extracted value.
- Under Extract JSON Key from String (overrides "New Output JSON Key"), optionally set the JSON Key Containing String of Keys plus its own Delimiter and Index to derive the output key name dynamically.
For example, the value string "21.5,18.9,22.1" with Index 1 extracts "18.9". Pairing this with a keys string "temperature,humidity,pressure" at the same index can dynamically output "pressure": "1013". Prefer fixed output keys when downstream systems expect consistent field names.
Queue NodeLogic
Buffers incoming payloads in a FIFO queue and releases them one at a time on a fixed timer, useful for rate-limiting downstream calls, spacing out data, or preventing floods.
How to configure it:
- Set the required Node Name.
- Set the required Time Between Output Payloads in seconds, the delay between emitted payloads.
- Set the required Limit Queue Size (default 100).
Calculate Value for Label-Matched UIDs NodeLogic
Works like Calculate Value for UID, but aggregates across every device sharing a label rather than just one UID, for example, rolling up values across devices tagged with a given Zone or Machine. See Core Concepts: Labels for how label values are set and kept consistent across Tables, Workflows, and User Groups.
How to configure it:
- Drag the node from the Logic panel and connect your upstream sources.
- Set the Node Name.
- Set the JSON Key to evaluate (for example, "power_kw").
- Choose the Calculation type (Sum, Average, Min, Max, Count, and more, this node offers more options than the UID version).
- Set the Calculation Time Span and Calculation Time Span Units (Seconds, Minutes, or Hours).
- Optionally set Calculation Ends (defaults to the current timestamp).
- Set the Time Zone.
- Select one or more Data Source Label(s) to group by.
- Optionally set the Output JSON Key and Decimal Places.
Update Tables NodeLogic
Writes data into a Rayven Table, matching the incoming payload against an existing row by key. It creates a new row if there's no match (upsert), and can also be switched to delete matching rows instead.
How to configure it:
- Drag the node from the Logic panel.
- Set the required Node Name.
- Use the required Select Table dropdown to choose the target table.
- Under Update & Edit Table Fields, add a row with a required Write JSON key and a required To Column, typically matching on UID.
- Click + Add for further Write JSON key / To Column pairs to update more fields.
- Under Delete Table Rows, optionally enable "Enable to remove rows" (off by default) to switch to delete behavior, which reveals an Input data field / Value condition for which rows to remove.
Rule Builder NodeLogic
A no-code visual condition builder that lets you define "if" statements with structured conditions, which are auto-translated into JavaScript for evaluation.
How to configure it:
- Set the required Node Name.
- Choose the required Error Handling Action (for example, "Continue – Add Error to JSON").
- "Output Zero if Value Not Found" is on by default.
- Build a condition: Condition (e.g. If), Field (dot notation supported), Operator (==, !=, <, >, contains, etc.), and one or two Value fields depending on the operator.
- Click the + icon on a row to add more conditions, or Add Operator to combine them with AND/OR, these compile into one JavaScript expression, shown live in the preview box below.
- Click Preview JS Code to review the generated JavaScript before saving. Only structured, UI-built conditions are accepted; raw JS input isn't supported.
Case NodeLogic
Evaluates one or more IF/THEN cases against the payload, setting an output variable when a condition matches.
How to configure it:
- Set the required Node Name.
- For each case, set the IF row's required Variable Name, required Operator (e.g. =), and required Value.
- Set the THEN row's required Variable Name and required Value to apply when the IF condition matches.
- Click + Add Case to evaluate additional conditions.
Count Value NodeLogic
Increments a running counter whenever incoming data matches a defined value, outputting the cumulative total. Unlike Count Value by Time, there's no time window, it accumulates until reset.
How to configure it:
- Drag the node from the Logic panel and connect it to the node(s) emitting the data to monitor.
- Set the required Node Name.
- Enter a Field to Count as a label for this counter.
- Set the required If condition: Field Name and Field Value (matched with "="), to only count matching events.
- Set the required Output Field Name.
- Click + Add Field to Count to track additional counters.
Data Summary NodeLogic
Summarizes multiple payload fields on a fixed schedule, for example, averaging several fields every few minutes, and outputs the results together.
How to configure it:
- Set the required Node Name.
- Choose the Calculation Interval (e.g. 5 Minutes) and optionally an Output Delay in minutes.
- Choose the Time Zone Setting (e.g. UID Time Zone).
- Optionally set an Additional Delay Between Output Payloads in milliseconds.
- Choose what to Apply To (e.g. UID).
- For each field, set the required JSON Key, required Calculation (e.g. Average), required Output JSON Key, and required Nested JSON Objects (Yes/No); click + Add Column for more fields.
Data Repository NodeLogic
Stores payload data in a custom, schema-defined repository with configurable retention and uniqueness rules.
How to configure it:
- Set the required Node Name.
- Set the required Data Retention Time Span and required Time Span Units (e.g. Days).
- Optionally toggle "Treat UID as unique (store latest value only)" and/or "Treat timestamp as unique (store latest value only)" (both off by default).
- For each field, set the required JSON Key, required Data Type (e.g. INT), and required Unique Key (Yes/No); click + Add Column for more fields.
Push to Interface NodeLogic
Stores data passed through a workflow so it can act as an endpoint that other nodes or widgets call to retrieve it. It's most commonly called from the Interface Builder's Code tab to pull workflow data into a custom interface component.
How to configure it:
- Drag the node from Logic → Custom Logic.
- Set the required Node Name.
- Click + Add to add a row for each field from the incoming payload you want saved, and set its required Field Name, only explicitly added fields are saved, and everything else is dropped. For example, from an incoming payload of
{"a":111,"b":222,"c":333}, adding only a and b saves just those two.
Push from Interface NodeLogic
Receives data sent from an Interface's Code tab via pushPayload(), making it available to the rest of the Workflow. Each node instance has its own unique Node ID, and the calling function must pass that ID as its nodeId argument to target this specific node.
How to configure it:
- Drag the node from Logic → Custom Logic.
- Set the required Node Name.
- Copy the node's Node ID from its configuration panel, and pass it as the
nodeIdargument when callingpushPayload()from the Interface Builder's Code tab.
Frequently Asked Questions
What's the difference between the Function Node and the JavaScript Node?
The Function Node uses a formula expression language (field references, math, date/time, and lookup functions) and is meant for calculations without writing real code. The JavaScript Node runs actual custom JS, including its own set of PascalCase helper functions like GetDataFromTable. Use the Function Node for simple expressions and the JavaScript Node when you need loops, conditionals, or logic the formula language can't express.
Why isn't my Calculate Value for UID node outputting anything?
This node relies on payload timestamps and only works on numeric fields, if the JSON key you're aggregating isn't numeric, or there's no data in the current time window, it outputs 0 rather than erroring. Confirm the field is numeric and that payloads are actually arriving inside the window you configured.
Should I use Calculate Value for UID or Calculate Value for Label-Matched UIDs?
Use Calculate Value for UID when you're aggregating one specific device's data over time. Use the Label-Matched version when you want to roll up a value across every device sharing a label (like a Zone or Machine), it also supports more calculation types (Average, Min, Max, Count), not just Sum.
Can the JavaScript Node call an external library like lodash or moment.js?
No. The JavaScript Node supports standard ES5/ES6 (loops, functions, conditionals) but external libraries aren't available. Use the node's built-in helper functions, such as GetDataFromTable or GetDataFromAPINode, instead of pulling in a package.
My Update Tables Node is creating duplicate rows instead of updating, why?
Update Tables upserts based on the Write JSON key / To Column pair you match on, if that target column isn't actually unique/indexed on the table, or the incoming key doesn't exactly match an existing row's value, it creates a new row instead of updating one. Confirm the matching column (typically UID) is set up as a unique key.
Where does a Logic node's calculated result actually get stored?
It depends which output node you connect it to: an Update Tables node writes into a Table (MySQL), while a Push to Interface node writes into Cassandra for a live Interface feed. See Core Concepts for the full comparison.
How do I show a Logic node's calculated result on an Interface?
Write it to a Table and read it back with getDataFromTable(), or use the Push to Interface node and call getDataFromAPINode(), both are called from the Interface's Code tab. The Data Sources tab only lets you inspect the available fields; it doesn't display them on its own. See Interfaces and Interface Builder JS Functions for both paths.
Where do I find the nodes that bring data into a workflow in the first place?
See the Connector Nodes Reference for every input, source, and control node available before a Logic node runs.
Where do I find the nodes that send a final result somewhere, like email or an API?
See the Output Nodes Reference for every node that delivers workflow data out, email, SMS, APIs, FTP, MQTT, and more.