---
id: scripting
title: "Scripting"
summary: "Write the steps a plugin doesn't cover in C#, Python or JavaScript. How script components work, which language to choose, and where scripts appear besides script components."
audience: user
keywords: "scripting, script, csharp, c#, python, javascript, services, Next, execute"
---
# 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** (`Services` in C#, `services` in Python and JavaScript): logging, settings, storage, assets,
  batches and more, under the same names in all three languages. See [Flow services](./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](./csharp), with the C# shared script for code used by several components.
- [Python script](./python).
- [JavaScript script](./javascript).
- [Decision conditions](./decision-conditions): route records with a C# condition.
- [Pre-execution scripts](./pre-execution): change a component's configuration for each message.
- [Flow services](./services): everything `Services` offers.
- [Cookbook](./cookbook): short recipes in all three languages.
