Flow Studio
Default Engine — Jint
Jint is an embedded JavaScript interpreter for .NET. It is the default expression evaluation engine in Flow Studio — no external process or runtime is required. Jint evaluates JavaScript expressions synchronously within the ASP.NET Core process with security constraints based on node certification.
How Jint Is Used
Project: BizFirst.Ai.ProcessEngine.JS.Services
Class: ExpressionEvaluator (implements IExpressionEvaluator)
The evaluator creates a Jint Engine instance per evaluation call, injects the context variables as named properties, then calls engine.Evaluate(expression).
// Internal Jint evaluation flow (ExpressionEvaluator.cs)
var engine = JintSecurityConfiguration.CreateEngine(isolationMode);
// Inject context variables into the engine scope
foreach (var variable in executionVariables)
{
engine.SetValue(variable.Key, variable.Value);
}
// Evaluate and extract result
var result = engine.Evaluate(expression);
return result?.ToObject();
Isolation Modes
The Jint engine runs in one of two security modes determined by the node's certification status:
| Mode | When | Constraints |
|---|---|---|
| High Isolation | Uncertified nodes (user-defined or untrusted) | No file/network access, timeout enforced (default 5s), restricted APIs |
| Low Isolation | Certified nodes (platform-signed, verified safe) | Longer timeout, some additional APIs permitted |
Expression Examples (Jint)
// Simple field reference — resolved by directive system, not Jint
@{output:http-request-1.statusCode}
// JavaScript expression in @{js:...} directive — evaluated by Jint
@{js: $output['http-request-1'].statusCode === 200 ? 'ok' : 'error'}
// String concatenation
@{js: $output['form-1'].firstName + ' ' + $output['form-1'].lastName}
// Arithmetic
@{js: Math.round($output['calc-1'].amount * 1.1)}
// Conditional (ternary)
@{js: $var.retryCount > 3 ? 'exhausted' : 'retry'}
Jint Limitations
| Limitation | Detail |
|---|---|
| Timeout | Default 5 seconds per expression — complex computations may be rejected |
| No async/await | Jint evaluates synchronously — expressions cannot await promises |
| No require / import | Cannot import external modules — only built-in JS globals available |
| No file/network access | Sandboxed — XmlHttpRequest, fetch, FileSystem APIs are disabled |
| ES2020 support | Jint supports ES2020 spec — older and newer features may vary |
Use Directive Syntax for Simple References
For simple field references (
@{output:nodeId.field}), the directive resolver handles resolution directly without invoking Jint. Reserve @{js:...} for cases where computation is needed. Directive-based resolution is faster and does not consume the Jint timeout budget.