Introduction to Windmill
Windmill is an open-source developer platform designed to create and manage internal tools effectively. Its primary function is to facilitate the development of APIs, background jobs, workflows, and user interfaces (UIs). As a self-hostable solution, Windmill offers a viable alternative to other platforms like Retool, Pipedream, and Superblocks, while simplifying processes akin to Temporal. A noteworthy feature of Windmill is its ability to auto-generate UIs, turning scripts into functional internal applications.
Main Concepts
Windmill simplifies workflow creation through a series of steps:
-
Script Definition: Developers can use languages such as Python, TypeScript, Go, or Bash to write scripts for specific tasks. These scripts are then developed using a convenient Web IDE or synced with a GitHub repository.
-
Automatic UI Generation: Once scripts are defined, their parameters are auto-parsed to generate a corresponding frontend. This process eliminates the need for extra coding to create an interface.
-
Flow Composition: Scripts can be chained together into comprehensive workflows. Additionally, these workflows can include scripts shared by the community on the WindmillHub.
-
UI Building: Complex UIs can be built on top of these scripts and workflows, offering a rich user experience. Workflows and scripts can also be scheduled using cron jobs or triggered via webhooks.
Script Code Example
Windmill supports scripting in various languages, including Python and TypeScript. Here's an example of a simple TypeScript script:
import * as wmill from "windmill-client"
import * as cowsay from '[email protected]';
type Postgresql = {
host: string;
port: number;
user: string;
dbname: string;
sslmode: string;
password: string;
};
export async function main(
a: number,
b: "my" | "enum",
c: Postgresql,
d = "inferred type string from default arg",
e = { nested: "object" }
) {
const email = process.env["WM_EMAIL"];
let variable = await wmill.getVariable("f/company-folder/my_secret");
const lastTimeRun = await wmill.getState();
console.log(cowsay.say({ text: "hello " + email + " " + lastTimeRun }));
await wmill.setState(Date.now());
return { foo: d, variable };
}
Unique Features
- Open Source: Windmill is fully open-source under the AGPLv3 license, providing transparency and flexibility.
- Various Language Support: Handles scripts written in Python, TypeScript, Go, Bash, SQL, and GraphQL.
- Comprehensive CLI: A powerful Command Line Interface (CLI) helps interact with the platform, allowing script synchronization and execution.
- Fast Workflow Engine: Benchmarked as the fastest self-hostable workflow engine, outperforming others like Airflow and Prefect.
Security and Performance
Security is a core component of Windmill. It uses sandboxing technologies like Google's nsjail to ensure scripts run securely in a multi-tenant environment. Sensitive data like secrets and credentials are encrypted using workspace-specific keys, and it is recommended to encrypt the entire PostgreSQL database for added security. Performance-wise, Windmill ensures minimal latency, maintaining high efficiency during script execution.
Self-Hosting and Deployment Options
Windmill offers several deployment methods, catering to various infrastructures:
- Docker Compose: Quickly deploy Windmill with a simple setup, consisting of a few configuration files.
- Kubernetes and Helm Charts: Helm charts are available for those using Kubernetes.
- Binary Releases: Pre-built binaries are available for manual installations.
Conclusion
Windmill stands out as a robust and versatile tool for developers seeking to build and manage internal tools effectively. Whether through self-hosting or contributed resources, Windmill offers flexibility and a wide array of features to cater to diverse development needs. Its open-source nature ensures continuous improvement and adaptability in response to community-driven innovation.