Skip to main content

Analysis Overview

Analysis lets you run custom code to process device data, automate workflows, and work with your TagoIO resources.

Common uses include:

  • Convert units and calculate values from device readings
  • Read data across devices to correlate events
  • Write calculated values into devices
  • Send emails, SMS messages, notifications, or webhooks
  • Create devices and manage resources such as files and user tags

The operations available to a script depend on its runtime.

Analyses can run on demand, through scheduled or conditional Actions, from Dashboard UI elements, or through API requests.

Environments

You can run an Analysis on TagoIO or on your own infrastructure.

TagoIO

Hosted Analyses run as an asynchronous, serverless service. Executions can overlap, and their execution order is not guaranteed.

Hosted Deno, Node.js, and Python scripts consume your Profile's monthly Analysis Service allowance, measured by execution duration.

Luau runs do not consume that monthly allowance. They have a separate run rate limit. Device operations performed by a Luau script remain subject to the applicable service and rate limits.

External

External Analyses run on your computer or server and do not consume the monthly Analysis Service allowance.

TagoIO provides a JavaScript SDK for Deno and Node.js, a Python SDK, and the TagoIO CLI for development tooling.

For a local execution workflow, see Running Analysis externally with Node.js.

Luau does not support External execution.

Runtimes

TagoIO supports these runtime options:

  • Deno (deno-rt2025): TypeScript and JavaScript, with dependencies resolved from imports.
  • Node.js (node-rt2025): JavaScript, bundled locally before upload when hosted on TagoIO.
  • Python (python-rt2025): Python, with dependencies declared in the script.
  • Luau (luau-rt2026): Device and entity operations and calls to other Analyses, using built-in functions instead of the SDK.
  • Other (other): Code hosted on your own infrastructure in a language or runtime TagoIO does not host.

Deno, Node.js, and Python provide SDKs for working with TagoIO resources. Luau has a smaller set of functions for device-focused tasks.

See Analysis Runtimes to choose an option.

Getting Started

  1. Create an Analysis.

    Open the Analysis module, create an Analysis, and select its runtime and execution environment. See Creating Analysis for the available fields.

  2. Grant the required permissions.

    Create an Access Management policy that targets the Analysis. Allow only the operations and resources the script needs.

  3. Write the script.

    Use the SDK for Deno, Node.js, or Python. For Luau, follow the first-script example.

    Store configurable values, such as device IDs, in environment variables. Consider how repeated execution affects writes and notifications so the same input does not produce unintended duplicates.

  4. Run and verify.

    Execute the Analysis on demand. Check its logs and confirm the expected result, such as a new device value or an updated resource. For hosted scripts, use the Analysis console to inspect output and errors.

  5. Add triggers when the script is ready.

    • Actions: run on a schedule or when a condition is met.
    • Dashboards: run from buttons, inputs, or other supported UI elements.
    • External services: request execution through the Run Analysis API, POST /analysis/:analysis_id/run.

    Triggering an Analysis from an external service does not require changing its execution environment to External.