Appearance
Scripting
Most of a flow is configured, not coded. When a step needs logic no plugin offers - a calculation, a rule, a format of your own - put a script component there and write that step in C#, Python or JavaScript. The rest of the flow stays visual.
How a script component works
A script component receives each record on its Input pin, runs your code, and sends records on with Next. Your code gets three things:
- the record, as an object of its flow type with real properties (
inputData.Email), - the metadata of the message, which you pass on with the records you send,
- the flow services (
Servicesin C#,servicesin Python and JavaScript): logging, settings, storage, assets, batches and more, under the same names in all three languages. See Flow services.
Call Next once to pass one record on, several times to split a record into many, or not at all to drop it. When the component's Output has no connection, pass the input on. Every flow type is available as a class, so you create output records with new CustomerDto() (C#, JavaScript) or CustomerDto() (Python).
An exception stops the record and goes to the flow's error handling, like an error in any other component.
Choose a language
| C# | Python | JavaScript | |
|---|---|---|---|
| Runs as | Compiled into the flow's assembly | CPython 3.11+ embedded in the host | V8 embedded in the host |
| Speed | Fastest; compiled code | Interpreted | JIT-compiled |
| Libraries | NuGet packages added to the flow | pip packages installed in the host's Python | Built-ins, fetch, timers; no modules |
| Messages | In parallel (or one instance per message) | One at a time per component | One at a time per component |
| Editor | Completion, hover and live compile errors | Syntax highlighting; full completion in your own IDE with the viaducta package | Syntax check |
| Debugger | Breakpoints and stepping | Line tracing with local variables | Breakpoints, stepping, variables |
Use C# for throughput and for anything that needs .NET libraries. Use Python when your team writes Python or needs a Python package. Use JavaScript for light transformations and HTTP calls with fetch.
Pages
- C# script, with the C# shared script for code used by several components.
- Python script.
- JavaScript script.
- Decision conditions: route records with a C# condition.
- Pre-execution scripts: change a component's configuration for each message.
- Flow services: everything
Servicesoffers. - Cookbook: short recipes in all three languages.