Skip to content

Variables and expressions

Variables turn a fixed transaction plan into a reusable template. A run supplies their concrete values before publication.

  1. Choose a stable key such as recipient or amountWei.
  2. Select the value kind expected by the transaction argument.
  3. Add a description that tells the run creator what to enter and in which unit.
  4. Reference the variable from a transaction value or argument.

txcast stores references as structured data. Do not type {{recipient}} or use string interpolation.

Expressions use txcast-cel-v1. Computed values can reference other workflow variables and are evaluated when the run is rendered.

For EVM amount math, use the supported Uint256 and Int256 semantics. These preserve Solidity-sized integer behavior and avoid JavaScript floating-point errors.

amountWei * feeBps / 10000

Signed remainder and unsigned modulo follow Solidity integer behavior.

Expression dependencies must be acyclic. Condition expressions bind their fetched onchain value to the reserved key value; do not create a workflow variable with that key when a condition needs it.

Before publication, inspect the final rendered destination, value, function, and arguments. A valid expression can still represent the wrong business amount if its inputs or units are wrong.

If validation reports a missing, incompatible, or cyclic variable, return to the workflow definition, correct the key or type, and save a new revision.