home / skills / windmill-labs / windmill / write-script-bigquery
This skill assists you write clean BigQuery queries by guiding parameter naming, syntax, and best practices for scalable analytics workflows.
npx playbooks add skill windmill-labs/windmill --skill write-script-bigqueryReview the files below or copy the command above to add this skill to your agents.
---
name: write-script-bigquery
description: MUST use when writing BigQuery queries.
---
## CLI Commands
Place scripts in a folder. After writing, run:
- `wmill script generate-metadata` - Generate .script.yaml and .lock files
- `wmill sync push` - Deploy to Windmill
Use `wmill resource-type list --schema` to discover available resource types.
# BigQuery
Arguments use `@name` syntax.
Name the parameters by adding comments before the statement:
```sql
-- @name1 (string)
-- @name2 (int64) = 0
SELECT * FROM users WHERE name = @name1 AND age > @name2;
```
This skill helps you write BigQuery queries that integrate with the platform’s script workflow. It enforces parameter syntax and metadata conventions so queries become reusable, parameterized scripts ready for deployment. Use it whenever you craft SQL that will run inside the platform’s script engine or be exposed as a webhook/workflow step.
The skill inspects SQL and ensures parameters use the @name syntax and that each parameter is declared in a preceding comment with type and optional default. It also guides placement of script files in the expected folder layout and reminds you to run the platform CLI commands to generate metadata and deploy. The output is a script file compatible with the platform’s metadata and lockfile generation process.
How do I declare parameters for a BigQuery script?
Add comment lines immediately above the statement using the pattern: -- @paramName (TYPE) = default. Then reference the parameter in SQL with @paramName.
What CLI steps are required to deploy the script?
Place your script file in the scripts folder, then run the metadata generation command followed by the sync push command to deploy. Also use the resource-type list command to discover available resource types.