Feature

Introducing Luau for Analysis

Read stored device data, calculate new values, and update entities with Luau, an Analysis runtime with built-in helpers and no Analysis Token.

TagoIO Team · · Updated
Introducing Luau for Analysis

Luau is now available for Analysis in TagoIO. Write Luau scripts that read stored device data, calculate new values, and save the results using built-in helpers. Your code runs on TagoIO, with no SDK to add and no Analysis Token to manage.

A sensor’s latest reading does not always tell the whole story. You may need an average of recent temperatures, a running total, or a status calculated from several readings. Luau is designed for these small, frequent jobs that work with data already in TagoIO. The script handles the calculation; Access Management controls which resources it can use.

Turn stored readings into useful values

A greenhouse sensor records temperatures of 24, 26, and 28 °C. A Luau Analysis can read those records, calculate their average, and save 26 °C back to the device as temperature_avg, leaving the original readings available.

A Luau Analysis reads stored temperatures of 24, 26, and 28 °C, averages them to 26 °C, and writes temperature_avg to the device

The built-in Devices functions handle device access and data operations. Entities reads and writes entity rows, and Analysis.list finds the Analyses your policy permits. There is no separate API client to configure for these operations.

Other useful jobs follow the same pattern:

  • Calculate water consumption from stored pulse counts and save the result in liters.
  • Compare recent readings with a threshold and write a status variable to the device.
  • Save a computed reading in an entity row, or update an existing row.
  • Read device configuration parameters and update settings for a permitted group of devices.

Use a Payload Parser when you only need to transform an incoming device payload. Choose Luau Analysis when the work also needs stored data, additional writes, or changes to device settings.

Work with results synchronously

Luau’s device and entity calls return their results directly to your script. Read the data, calculate a value, and save it in sequence, without writing Promise chains or callbacks. In the greenhouse example, the average uses the completed read, and the write finishes before the script continues.

Synchronous execution does not mean zero latency. Reading data and running calculations still take time, and ordinary hosted Analysis triggers do not return the script’s result to the caller.

Update, October 15, 2026: Analysis Endpoints give a Luau Analysis a synchronous HTTP request-and-response flow. The caller waits for the script and receives its answer in that same request. Validate an input, calculate a value, or read device data and return the result as soon as the script finishes, rather than asking the application to retrieve it later.

Compare runtime speed on the same workload

A sensor-data processing comparison across runtimes:

Median execution time
Runtime1,000 readings100,000 readings
Luau 0.728 0.74 ms30.60 ms
Bun 1.4.2 19.21 ms27.49 ms
Deno 2.4.4 30.63 ms37.87 ms
Node.js 24.21.0 29.74 ms37.98 ms
Python 3.13 69.70 ms138.52 ms

Each runtime uses the version TagoIO hosts. Luau runs inside TagoIO without starting a separate process, so its times cover only the script. The other runtimes start a new process on every run, and that startup accounts for most of their time at 1,000 readings.

Access rules, without a token

A Luau Analysis gets its permissions from an Access Management policy, not an Analysis Token. Target the Analysis directly or through one of its tags, then allow the actions it needs on the intended resources.

Access Management lets a Luau Analysis read and write the Greenhouse sensor while blocking an unrelated device, with no Analysis Token

For the greenhouse average, grant permission to fetch the sensor, read its data, and write the calculated value. That does not grant access to an unrelated device. A read or write without the required permission is blocked.

Keep each script focused

Luau runs only on TagoIO. It has no outbound internet access, external libraries, or file access, and cannot send emails, SMS messages, or notifications directly.

Choose Luau for small jobs that stay within its built-in device, entity, and Analysis operations, such as averaging readings and saving the result. Choose Bun when the script needs an external API, a package, or other TagoIO resources.

If a calculated value needs an external response, keep that step in a Deno, Node.js, or Python helper Analysis. For example, the greenhouse script can start a notification helper only when the average crosses a threshold. Analysis.run starts the helper without waiting for it to finish and requires Run Analysis permission on the target. It cannot start another Luau Analysis.

Luau executions do not count toward the monthly Analysis Service limit. Device and entity operations still follow applicable service, resource, and rate limits. The runtime also limits execution time, memory, and payload size; consult the Luau limits when sizing a job.

Get started

Start with a new Analysis and a test device containing numeric readings in the same unit.

  1. In Admin, create an Analysis and select Luau (luau-rt2026) in Runtime.
  2. Configure its Access Management policy before running any device or entity operations.
  3. Open the Script Editor and use the Luau example. Keep device IDs and settings in environment variables.
  4. Save the script and click Run. Inspect the saved values and console output. Use print(...) for logs; argument errors identify the invalid option.

If you are migrating existing code, read the runtime-switching warnings first: switching to Luau removes the existing Analysis Token.

Read the Luau runtime guide for the supported functions and the September 16 release notes for the announcement.