Errors and Resource Limits
Script diagnostics fall into two categories: Static (Compile-Time) Errors detected when editing and saving the node, and Runtime Errors raised during workflow execution.
Static Errors (Compile-Time)
Static errors block saving in the Properties modal and report the exact line:column. If a saved workflow fails static checking when opened (e.g., an unsupported script version), the node fails at runtime with SCRIPT_COMPILE_ERROR.
Syntax Diagnostics
| Diagnostic Code | Meaning & Resolution |
|---|---|
SCRIPT_SYNTAX_SOURCE_TOO_LARGE | Script source exceeds 64 KiB. Factor repeated logic into functions or loops. |
SCRIPT_SYNTAX_TAB_INDENT | Tab character used in indentation; indent with 4 spaces per level. |
SCRIPT_SYNTAX_INDENT_UNIT | Indentation is not a multiple of 4 spaces. |
SCRIPT_SYNTAX_INDENT_TOO_DEEP | Indentation increased by more than one 4-space level at once. |
SCRIPT_SYNTAX_UNEXPECTED_INDENT | Indented line where no block was opened. |
SCRIPT_SYNTAX_EXPECTED_INDENT | Missing indented block after a colon (:). |
SCRIPT_SYNTAX_BLOCK_SAME_LINE | Block body written on the same line after :; place the body on the next line indented by 4 spaces. |
SCRIPT_SYNTAX_SEMICOLON | Semicolon (;) used to join statements; write one statement per line. |
SCRIPT_SYNTAX_LINE_CONTINUATION | Backslash (\) line continuation used; wrap multi-line expressions in parentheses instead. |
SCRIPT_SYNTAX_UNCLOSED_BRACKET | Unclosed parenthesis ( or bracket [. |
SCRIPT_SYNTAX_UNMATCHED_BRACKET | Closing parenthesis or bracket with no matching opener. |
SCRIPT_SYNTAX_BRACE | Curly braces { } used outside an f-string (dicts and sets are not supported). |
SCRIPT_SYNTAX_UNKNOWN_CHAR | Unrecognized character outside string literals and comments. |
SCRIPT_SYNTAX_RESERVED_NAME | Identifier starts with a reserved double underscore (__). |
SCRIPT_SYNTAX_FLOAT | Floating-point literal used; only integers are supported. |
SCRIPT_SYNTAX_INVALID_NUMBER | Malformed integer literal. |
SCRIPT_SYNTAX_SINGLE_QUOTE | Single-quoted string used; use double quotes ("..."). |
SCRIPT_SYNTAX_UNTERMINATED_STRING | String or byte literal is missing its closing quote. |
SCRIPT_SYNTAX_BAD_ESCAPE | Unsupported escape sequence (only \\, \", \n, \r, \t, and \uNNNN are allowed). |
SCRIPT_SYNTAX_HEX_INVALID_CHAR | h"..." literal contains non-hex characters (or a 0x prefix). |
SCRIPT_SYNTAX_HEX_ODD_DIGITS | h"..." literal has an odd number of hex digits. |
SCRIPT_SYNTAX_BIN_INVALID_CHAR | b"..." literal contains characters other than 0, 1, and space (use h"..." for hex or s"..." for UTF-8 text). |
SCRIPT_SYNTAX_BIN_BIT_COUNT | b"..." literal bit count is not a multiple of 8. |
SCRIPT_SYNTAX_LITERAL_PREFIX_SPACE | Whitespace between literal prefix (h/b/s/f) and opening quote. |
SCRIPT_SYNTAX_LITERAL_MIXED_KIND | Adjacent concatenation mixed different literal kinds; join them with + instead. |
SCRIPT_SYNTAX_LITERAL_CONCAT_OUTSIDE_PAREN | Adjacent literal concatenation outside parentheses; wrap in (...) or use +. |
SCRIPT_SYNTAX_FSTRING_BRACE | Unescaped single } in f-string; write }} for a literal brace. |
SCRIPT_SYNTAX_FSTRING_FIELD | Malformed f-string interpolation field (quotes, braces, and backslashes cannot appear inside the expression). |
SCRIPT_SYNTAX_FSTRING_EMPTY | Empty interpolation field {} in f-string. |
SCRIPT_SYNTAX_UNEXPECTED_TOKEN | Unexpected token in statement or expression. |
SCRIPT_SYNTAX_UNSUPPORTED | Unsupported Python construct (import, class, while, lambda, try, print, etc.). |
SCRIPT_SYNTAX_UNSUPPORTED_OPERATOR | Unsupported operator (** or /); use pow(base, exp, mod) or //. |
SCRIPT_SYNTAX_ATTRIBUTE | Attribute access or method call (.); call built-in functions directly. |
SCRIPT_SYNTAX_COMPREHENSION | List comprehension used; use a for loop with += [item]. |
SCRIPT_SYNTAX_CHAINED_COMPARISON | Chained comparison (a < b < c); write (a < b) and (b < c). |
SCRIPT_SYNTAX_CALL_TARGET | Attempted to call a non-identifier expression. |
SCRIPT_SYNTAX_POSITIONAL_AFTER_KEYWORD | Positional argument follows a keyword argument. |
SCRIPT_SYNTAX_EXPR_STATEMENT | Non-call expression used as a standalone statement. |
SCRIPT_SYNTAX_DANGLING_ELSE | elif or else without a matching if. |
SCRIPT_SYNTAX_NESTED_DEF | Function defined inside another block; define all functions at the top level. |
SCRIPT_SYNTAX_ANNOTATION_NO_VALUE | Type annotation without an initializer (write x: int = 0). |
SCRIPT_SYNTAX_UNPACK_RHS | Right-hand side of tuple unpacking is neither a tuple nor a function call. |
SCRIPT_SYNTAX_TUPLE_CONTEXT | Tuple used outside a return statement or unpacking assignment. |
SCRIPT_SYNTAX_TUPLE_ARITY | tuple[...] return type annotation has fewer than 2 element types. |
SCRIPT_SYNTAX_PARAM_TYPE | Function parameter is missing its type annotation. |
SCRIPT_SYNTAX_PARAM_DEFAULT | Default parameter value specified on a user-defined function. |
SCRIPT_SYNTAX_UNKNOWN_TYPE | Unknown type name in annotation (use int, bool, bytes, string, or list[...]). |
SCRIPT_SYNTAX_NESTED_LIST | Nested list type annotation list[list[...]] is not supported. |
Name, Type, and Flow Diagnostics
| Diagnostic Code | Meaning & Resolution |
|---|---|
SCRIPT_TYPE_MISMATCH | Type mismatch in assignment, condition, operator operand, or function argument. |
SCRIPT_OUTPUT_TYPE_MISMATCH | Value assigned to an output port variable does not match the port's declared data type. |
SCRIPT_OUTPUT_UNASSIGNED | An output port variable is not definitely assigned along all execution paths (see Definite Assignment Analysis). |
SCRIPT_UNASSIGNED | Variable read before it is guaranteed to be assigned on all paths. |
SCRIPT_INPUT_READONLY | Attempted to reassign or mutate a read-only input port variable. |
SCRIPT_NAME_UNDEFINED | Referenced an undefined variable or function name. |
SCRIPT_NAME_RESERVED | Used a built-in function name as a variable or user function name. |
SCRIPT_NAME_CONFLICT | Identifier collides with an existing function, variable, constant, parameter, or port. |
SCRIPT_CONST_NOT_TOP | All-uppercase constant defined inside a block rather than at the top level. |
SCRIPT_CONST_REASSIGN | Attempted to reassign or mutate an immutable constant. |
SCRIPT_CONST_INVALID | Constant initializer references non-constant variables or input ports. |
SCRIPT_FUNC_SCOPE | Function body references a top-level variable, input port, or output port directly. |
SCRIPT_FUNC_ORDER | Called a user function before its definition (or attempted recursion). |
SCRIPT_CALL_ARGS | Invalid argument count or keyword argument name in function call. |
SCRIPT_RETURN_OUTSIDE | return statement used outside a function. |
SCRIPT_RETURN_TYPE | Returned value does not match the function's declared return type. |
SCRIPT_RETURN_MISSING | Value-returning function has an execution path that does not end with return. |
SCRIPT_TUPLE_MISMATCH | Tuple unpacking target count does not match, or repeats the same target variable. |
SCRIPT_TUPLE_MISMATCH / SCRIPT_TUPLE_CONTEXT | Tuple value used outside unpacking or return. |
SCRIPT_RANGE_CONTEXT | range(...) used outside the header of a for loop. |
SCRIPT_LOOP_CONTROL_OUTSIDE | break or continue used outside a for loop. |
SCRIPT_EMPTY_LIST | Empty list [] used without an explicit type annotation (write xs: list[bytes] = []). |
SCRIPT_NESTED_LIST | Attempted to construct a nested list. |
SCRIPT_INT_LITERAL_TOO_LARGE | Integer literal exceeds 1,048,576 bits. |
SCRIPT_FORMAT_INVALID | Invalid f-string format specifier for the expression's type or width limit (> 4,096). |
Port Schema Diagnostics
| Diagnostic Code | Meaning & Resolution |
|---|---|
SCRIPT_PORT_INVALID_ID | Port name violates identifier syntax ([A-Za-z_][A-Za-z0-9_]*) or starts with __. |
SCRIPT_PORT_RESERVED_ID | Port name collides with a reserved keyword or built-in function name. |
SCRIPT_PORT_DUPLICATE_ID | Two ports on the Script node share the same name/ID. |
SCRIPT_PORT_INVALID_TYPE | Port data type is not one of bytes, int, bool, or string. |
Runtime Errors
| Error Code | Meaning | Example |
|---|---|---|
SCRIPT_COMPILE_ERROR | Saved script failed static verification or uses an unsupported script version. | — |
SCRIPT_DIVISION_BY_ZERO | Divisor of // or % is 0. | 1 // 0 |
SCRIPT_INDEX_OUT_OF_RANGE | List index or slice range is out of bounds. | [1, 2][5] |
SCRIPT_INVALID_ARGUMENT | Negative bit-shift count, zero range step, or invalid pow arguments. | 1 << -1 |
SCRIPT_INVALID_ERROR_CODE | Custom code passed to fail(code, message) starts with reserved SCRIPT_ or BYTES_. | — |
SCRIPT_SIZE_LIMIT | Integer bit length, list length, or loop iteration count exceeded 1,048,576. | 1 << 2000000 |
SCRIPT_STEP_LIMIT | Execution exceeded the 10,000,000 evaluation step limit. | — |
SCRIPT_TIMEOUT | Execution exceeded the wall-clock timeout (3 seconds in Web, 10 seconds in API Container). | — |
SCRIPT_INTERNAL_ERROR | Unexpected internal interpreter error. | — |
Byte Operation Errors
| Error Code | Meaning | Example |
|---|---|---|
BYTES_OUT_OF_RANGE | Byte index or slice range is outside the buffer bounds. | h"01 02"[2] |
BYTES_LENGTH_MISMATCH | Operands to a bytewise operator or slice assignment have different lengths. | h"01" ^ h"01 02" |
BYTES_INT_OVERFLOW | Integer cannot fit in the requested byte length and signedness. | to_bytes(256, 1) |
BYTES_INVALID_HEX | Invalid hexadecimal string passed to from_hex. | from_hex("zz") |
BYTES_INVALID_UTF8 | Invalid UTF-8 byte sequence passed to to_utf8. | to_utf8(h"c3 28") |
BYTES_INVALID_ARGUMENT | Negative length/count, out-of-range byte value, or invalid endianness string. | to_int(h"01", "middle") |
BYTES_SIZE_LIMIT | Resulting byte array exceeds the 16 MiB buffer limit. | zeros(20000000) |
Resource Limits
| Resource | Limit | Error Code When Exceeded |
|---|---|---|
| Evaluation steps | 10,000,000 | SCRIPT_STEP_LIMIT |
Single bytes buffer size | 16 MiB | BYTES_SIZE_LIMIT |
Single list length / for loop iterations | 1,048,576 | SCRIPT_SIZE_LIMIT |
Single int bit length | 1,048,576 bits | SCRIPT_SIZE_LIMIT (or SCRIPT_INT_LITERAL_TOO_LARGE) |
| Script source size | 64 KiB | SCRIPT_SYNTAX_SOURCE_TOO_LARGE |
| f-string field width | 4,096 | SCRIPT_FORMAT_INVALID |
| Wall-clock execution time | 3 s (Web) / 10 s (API Container) | SCRIPT_TIMEOUT |
o = 0
for i in range(1000000):
for j in range(100):
o += 1
o = 0
for i in range(2000000):
o += 1