Overview
What is Scripting
B2Win Suite includes a built-in scripting language with a TypeScript-like syntax. It allows you to write custom logic directly inside workflows — transforming data, calling APIs, setting properties, and controlling execution flow.
Where to Use
Scripting is available in the following areas of B2Win Suite:
| Area | Description |
|---|---|
| Custom Script | Write custom transformation logic on tabular data or files. |
| If-Else Condition | Evaluate a script that returns true or false and route the input accordingly. |
| Switch Case | Return 0, 1, or 2 to route the input to the matching output port. |
| Source Script (Table) | Generate tabular data from a script (e.g. call an API and return a table). |
| Source Script (File) | Generate a file from a script (e.g. fetch remote content and return a file). |
| Source Script (Object) | Generate a JSON object from a script. |
| Data Prep (Custom Column) | Add calculated columns using scripting expressions. |
| Properties | Define global or local property values using scripts. |
For scripting examples inside the Workflow Builder, see Scripting in B2Win Suite.
Scripting Reference
| Section | Topics |
|---|---|
| AI Assistant | Built-in AI Chat in the FlowCode Editor — generate, explain, and debug scripts and SQL queries. |
| Getting Started | Hello World, arithmetic, strings, conditionals, loops. |
| Language Basics | Variables, conditionals, comments, loops, error handling, structs. |
| Types & Objects | Primitive types, arrays, maps, and built-in objects (SuiteTable, LocalDate, JsonNode, etc.). |
| Utilities | Static utility classes accessed via util — HTTP, files, database, JSON, date/time, and more. |
| Contexts | Runtime context (execution info) and node input types (DataFrame, File, DataObject). |
| Properties | The Property class for reading and setting global and local properties. |
| Configurations | The Configs class for accessing workflow-level settings. |
Tutorial
Follow a step-by-step walkthrough to write your first script.
Feedback
Have suggestions or found a bug? Share your feedback.