Skip to content

Code actions

When the graph is not enough, the Code box runs a script.

Seven languages are available, all of them run inside an embedded WebAssembly sandbox: no interpreter is required on your machine, and the script has no access to your file system.

LanguageEngine
TypeScriptQuickJS (types stripped at compile time)
JavaScriptQuickJS
PythonPyodide (CPython compiled to WebAssembly)
LuaLua 5.4 in WebAssembly
RubyCRuby in WebAssembly
RWebR
C#.NET in WebAssembly with Roslyn

The default language is TypeScript.

Whatever the language, the box exposes the same thing:

Inputsvalue (named input), code (string)
Outputsresult
Configurationlanguage, code, timeout, packages
  • input — the value received on the input port.
  • vars — the run variables.
  • The language’s standard output (console.log, print, puts, cat, Console.WriteLine) feeds the execution log.
  • The value returned leaves on the result port. An error or a timeout leaves on error.

timeout, in seconds: 5 by default, 60 at most. A script that goes over is interrupted and execution leaves via the error port.

The packages field accepts a list of { name, version }. The exact versions serve as the cache key: dependencies are resolved on the first run, cached, then mounted offline on every subsequent run — CI included.

LanguageSource
TypeScript / JavaScriptnpm (the whole set is bundled)
PythonPure-Python wheels from PyPI
LuaLuaRocks (pure-Lua sources)
RubyPure-Ruby gems
RCRAN, via WebR’s WebAssembly repository
C#None — the .NET standard library only

Many needs are already covered by boxes, which are more readable and faster:

NeedBox
Extract a value from a responseA link selector
Format a stringTransform template
Filter, sort, aggregate a listLists
Hash, encode, signEncoding
Check a structureSchema validate

Keep the Code box for logic that really is specific.