GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Windmill
  • Platform
  • Script editor
  • Flow editor
  • App builder
  • Triggers
  • Data tables
  • Deployment & versioning
  • Local dev
  • Workers
  • AI sandboxes
  • Observability
  • RBAC
  • No-ops self-host

This view

  • Original page
  • New address

GeezerVison is showing www.windmill.dev — Script editor | Windmill

In Windmill, Scripts are the basis of all major features (they are the steps of flows, linked to apps components, used as backend runnables in full-code apps, or can be run as standalone).

A Script can be written in: TypeScript (Bun & Deno), Python, Go, Bash, PowerShell, Nu, SQL (PostgreSQL, MySQL, MS SQL, BigQuery, Snowflake, Oracle, DuckDB), REST & GraphQL, PHP, Rust, C#, Java, Ruby, Ansible, R or dbt. Any other language can run through Docker. Its two most important components are the input JSON Schema specification and the code content.


Scripts in languages with dependencies (TypeScript, Python, Go, PHP, Rust, C#, Java, Ruby and more) also have an auto-generated lockfile that ensures 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:

  • TypeScript
  • Python
  • Go
  • Bash
async function main(param1: string, param2: { nested: string }) {
...
}
def main(param1: str, param2: dict, ...):
...
func main(x string, nested struct{ Foo string \`json:"foo"\` }) (interface{}, error) {
...
}

There is no main needed for Bash. The body is executed and the args are passed directly.

Scripts quickstart
Start writing scripts in Python, TypeScript, Go, PHP, Bash and Sql.
JSON schema and parsing
JSON Schemas are used for defining the input specification for scripts and flows, and specifying resource types.
Auto-generated UIs
Windmill creates auto-generated user interfaces for scripts and flows based on their parameters.
Triggers
Trigger scripts and flows on-demand, by schedule or on external events.

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:

Settings
Each script has metadata & settings associated with it, enabling it to be defined and configured in depth.
Script kind
You can attach additional functionalities to Scripts by specializing them into specific Script kinds.
Generated UI
main function's arguments can be given advanced settings that will affect the inputs' auto-generated UI and JSON Schema.
Versioning
Scripts, when deployed, can have a parent script identified by its hash.
Concurrency limit
The Concurrency limit feature allows you to define concurrency limits for scripts and inline scripts within flows.
Job debouncing
Job debouncing prevents redundant job executions by canceling pending jobs with identical characteristics.
Running services with perpetual scripts
Perpetual scripts restart upon ending unless canceled.
Custom environment variables
In a self-hosted environment, Windmill allows you to set custom environment variables for your scripts.
Multiplayer
The Multiplayer feature allows you to collaborate with team members on scripts simultaneously.
Run scripts in VS Code
The Windmill VS Code extension allows you to run your scripts and preview the output within VS Code.
Debugger
Debug Python and TypeScript (Bun) scripts with breakpoints, variable inspection, call stack, and console.

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. Use workflow() and task() to define checkpoint-based orchestration where each task runs as a separate job with its own logs, and the workflow suspends between tasks.

Workflows as code

Workflows as code
Write distributed workflows in TypeScript or Python with checkpoint-based orchestration, parallel execution, and fault tolerance.

Code editor features​

For features specific to the Code editor, check:

Code editor
The code editor is Windmill's integrated development environment.
  • Script editor features
  • Workflows as code
  • Code editor features
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.