TxScript is a JavaScript-based scripting library that powers AI Builder features in 1Flow. It provides a safe, controlled way to write scripts that interact with your financial data through a capability-based API.
The key principle of TxScript is that all interactions go through a capability object (tx or uiTx) - scripts never access platform internals directly. This ensures security, validation, and proper resource management.
TxScript comes in two variants, each optimized for different use cases:
tx)uiTx / tx)All TxScript variants use a capability-based architecture:
TxScript supports async/await, allowing you to make HTTP requests and perform asynchronous operations. All async operations must go through capability methods, which enforce limits and security controls.
All variants enforce:
| Use Case | Variant | Documentation |
|---|---|---|
| Validate or transform a field during document extraction | Formula Fields (tx) | Formula Fields |
| Build an interactive dashboard or report | Mini Apps (uiTx) | Mini Apps |
| Schedule automated reports or workflows | Tasks (tx) | Tasks |
You have three options for working with TxScript:
TxScript code runs without AI at runtime, ensuring fast, reliable, and cost-effective execution.