Skip to content
Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

TBEL Overview

ThingsBoard Expression Language (TBEL) is a lightweight scripting language purpose-built for IoT data transformation. It is a fork of MVEL with additional security constraints and built-in memory management.

TBEL is the default scripting engine for Script calculated fields, rule engine filter and transformation nodes, and other server-side scripting contexts.

Prior to TBEL, ThingsBoard used Nashorn (the JDK-bundled JavaScript engine) for server-side scripting. Nashorn was deprecated in JDK 11 and removed in JDK 15 — leaving two alternatives:

  • GraalVM JavaScript — excellent but carries a heavy runtime footprint and licensing constraints that make it impractical for most self-hosted deployments.
  • Remote JS Executors — Node.js processes that receive scripts over the message queue. They work, but add inter-process communication latency and consume extra system resources.

TBEL was created to provide a fast, secure, zero-dependency scripting option that runs inside the JVM without external processes.

TBEL delivers roughly 1 000× better performance for typical transformation scripts.

Metric Nashorn TBEL
1 000 iterations of return msg.temperature > 20 ~16 000 ms ~12 ms
Startup cost per script High (JIT compilation) Negligible
Memory isolation Weak Strong (per-execution memory limit)
Security sandbox Manual, error-prone Built-in (restricted class access)
Aspect Remote JS Executors TBEL
Additional process Yes (Node.js) No
Network/queue overhead Yes No
Language Full ES6+ JavaScript MVEL-based (Java-like)
Use case Complex scripts that need full JS ecosystem Typical IoT transformations
  • Language Guide — syntax, data types, collections, and control flow.
  • Helper Functions — encoding, byte parsing, hex conversion, date/time, geofencing, and more.