windmill-labs/windmill
Overview
This skill provides concise conventions and examples for writing Deno/TypeScript scripts that run on the Windmill platform. It covers file structure, required exports, imports, resource handling, S3 operations, and how to use the windmill-client SDK. Use this whenever you author or maintain scripts intended to be deployed and executed in Windmill.
How this skill works
Write a single async exported function named main (or preprocessor for preprocessor scripts) that Windmill will call with parameters and resources. Use the RT namespace for typed resource inputs, import npm packages with the npm: prefix, and use the windmill-client SDK for platform interactions, state, and S3 I/O. After authoring, run the CLI commands to generate metadata and push the script to Windmill.
When to use it
- When building Deno/TypeScript scripts targeted at Windmill.
- When you need platform-integrated resource access (API keys, DB config).
- When you need to read/write files to S3 from a script.
- When you want to call or orchestrate other scripts or flows via the SDK.
- When writing preprocessor scripts to transform incoming events.
Best practices
- Export only a single async function named main for normal scripts; use preprocessor(event) for preprocessor scripts.
- Use the RT namespace for resource-typed parameters so credentials and configs are injected automatically.
- Import npm modules using the npm: prefix and Deno std libs via full URLs.
- Do not invoke main yourself; Windmill calls it with parameters and resource values.
- Use windmill-client methods (runScriptByPath, setState, loadS3File, etc.) for platform operations instead of custom HTTP hacks.
Example use cases
- A Deno script that accepts a Stripe RT resource and charges a customer using npm:stripe.
- A preprocessor that maps webhook body and query params into typed script inputs.
- A batch job that reads CSVs from S3, processes them with Deno streams, and writes results back to S3.
- A flow task that runs child scripts via wmill.runScriptByPath and aggregates results.
- A script that generates a DB URL from a database resource using wmill.databaseUrlFromResource.
FAQ
Import npm packages with the npm: prefix (e.g., import Stripe from "npm:stripe") or use Deno standard library URLs; Windmill handles installation at deploy time.
What export name should I use for preprocessor scripts?
Name the function preprocessor and accept an event object with kind, body, headers, and query to return the mapped parameters.
17 skills
This skill helps you write Deno/TypeScript scripts for Windmill by guiding structure, imports, and resource usage.
This skill creates a focused, single-line conventional commit by analyzing changes and staging files individually for precise commits
This skill helps you write GraphQL queries and mutations accurately by guiding structure, variables, and binding with your scripts.
This skill guides you in writing PHP scripts by structuring main function, resource types, and required libraries for Windmill workflows.
This skill helps you scaffold and manage Windmill raw apps, enabling frontend backends and datatables with best practices.
This skill guides you to write Snowflake queries with parameter placeholders and clear comments for naming, improving reliability and readability.
This skill helps you write PowerShell scripts by illustrating parameter declarations, typing, and structured return values for clear, reusable automation.
This skill helps you configure and manage external event triggers for Windmill, enabling seamless automation of scripts and flows.
This skill helps you write Java scripts with a standardized Main class, enabling structured input handling and JSON-friendly outputs.
This skill helps you write Bash scripts with positional arguments, JSON output, and Windmill integration for automation and deployment.
This skill helps you apply Svelte 5 best practices with Runes API for explicit reactivity, improving frontend code quality in Windmill projects.
This skill helps you write Go scripts for Windmill workflows, returning JSON-serializable results and proper error handling.
This skill helps you create and validate Windmill flows by guiding module IDs, inputs, and deployment steps for reliable automation.
This skill helps you craft PostgreSQL queries with proper parameterization, clear input naming, and safe execution across scripts and workflows.
This skill guides you in writing Rust scripts with a serializable return type and proper main signature for Windmill automation.
This skill helps you author Bun Native TypeScript scripts with built-in fetch usage and resource parameters for Windmill automation.
This skill enforces Rust backend coding guidelines to improve safety, readability, and maintainability when editing backend code.