Relationships
#3708 model.method in a workflow guard fails with 'Do not know how to serialize a BigInt' when its inputs hold an int
Opened by zack · 10/21/2026· Shipped 10/21/2026
Description
A workflow guard or assert that calls model.method with an integer in its inputs fails with:
InvalidExpressionError: Invalid expression: Do not know how to serialize a BigIntcel-js evaluates CEL ints as JavaScript bigint. The inputs map reaches the model.method delegate in WorkflowExecutionService (src/domain/workflows/execution_service.ts, the method: delegate that builds a synthetic step via StepTask.model(modelName, methodName, inputs)) with bigints still in it. Somewhere downstream the synthetic step's inputs are JSON-serialized, which throws on a bigint. Nested values (ints in lists or maps) are affected too.
String and boolean inputs work. Doubles (2.5) work.
This is on main today (option off). The typed-secrets design (Phase 3.5, design/enablers/typed-secrets.md Section 4.5 item 3) also hands the delegate "a plain copy, ints as cel-js's bigints", so the typed path inherits the failure; integration/typed_local_behavior_test.ts only passes string inputs, so it does not catch it.
Related, but a different path: #830 (data query --select BigInt serialization).
Steps to reproduce
swamp repo init --tool none- Create a
command/shellbehaviorsh1with methodexecuteandrun: "echo hi". - Create a workflow with a step whose guard is:
guard: "${{ model.method('sh1', 'execute', {'n': 1}).command.contains('hi') }}"
swamp workflow run <name>
Expected: the guard runs sh1.execute with input n = 1 and evaluates.
Actual: the step fails with InvalidExpressionError: Invalid expression: Do not know how to serialize a BigInt.
The same guard with {'n': 'one'} works.
Environment
- swamp built from
main(also reproduced on branchissue-3628) - Linux, Deno 2.9.7
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.