- Home
- Skills
- Windmill Labs
- Windmill
- Write Script Go
write-script-go_skill
- HTML
15.8k
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill windmill-labs/windmill --skill write-script-go- SKILL.md1.3 KB
Overview
This skill guides writing Go scripts that run inside the platform and become webhooks, workflows, or UI actions. It enforces the required package, function signature, and JSON-serializable return types so scripts integrate reliably. Follow the CLI steps to generate metadata and deploy scripts to the platform.
How this skill works
It inspects Go source files to ensure the package is named inner and that a function called main exists with a (T, error) return signature. It validates that return types are JSON-serializable and that errors are returned as the second value. After coding, it helps generate .script.yaml/.lock metadata and push the script to the platform using the CLI.
When to use it
- Writing new Go-based scripts for workflows or webhooks
- Converting script logic into a deployable platform action
- Ensuring Go functions meet the platform's packaging and signature rules
- Testing serialization compatibility of returned data before deployment
- Deploying scripts to self-hosted or cloud instances via the CLI
Best practices
- Use package name inner exactly; other names will not be accepted
- Name the exported function main (lowercase) and return (value, error) consistently
- Return only types that serialize to JSON (primitives, structs with json tags, maps, slices)
- Perform input validation and return descriptive errors as the second return value
- Run wmill script generate-metadata and wmill sync push after changes to update metadata and deploy
Example use cases
- Simple data transform: accept parameters, return a JSON-serializable struct for downstream steps
- Database lookup: query Postgres, return a map or struct with results and handle DB errors
- Webhook handler: parse input, perform action, return status object or error
- Automation task: execute business logic, expose count/status in returned JSON for dashboards
FAQ
Package must be named inner exactly.
How should my function be declared?
Export a function named main that returns (T, error), where T is any JSON-serializable type.