Skip to main content

Script Editor

In Windmill, Scripts are the basis of all major features (they are the steps of flows, linked to apps components, or can be run as standalone).

A Script can be written in: TypeScript (Deno & Bun), Python, Go, Bash or SQL. Its two most important components are the input JSON Schema specification and the code content.

Script languages

Python and Go Scripts also have an auto-generated lockfile that ensure that executions of the same Script always use the exact same set of versioned dependencies. To fit Windmill's execution model, the code must always have a main function, which is its entrypoint when executed as an individual serverless endpoint or a Flow module and typed parameters used to infer the script's inputs and auto-generated UI:

async function main(param1: string, param2: { nested: string }) {
...
}

For scripts with numerous lines of code (+1,000), we recommend splitting the logic into Flows or Sharing common logic.

Script Editor Features

The Script Editor is made of the following features:

Workflows as Code

One way to write distributed programs that execute distinct jobs is to use flows that chain scripts together.

Another approach is to write a program that defines the jobs and their dependencies, and then execute that program directly in your script. This is known as workflows as code.

Workflows as Code

Code Editor Features

For features specific to the Code Editor, check: