Windmill AI
Windmill provides ways to have AI help you in your coding experience.
If you're rather interested in leveraging OpenAI from your scripts, flows and apps, check OpenAI Integration.
To enable Windmill AI, go to the "Windmill AI" tab in the workspace settings and add a supported model's resource. Code completion is disabled by default, but you can enable it in the same tab.
Windmill AI for scripts
Generate Windmill-specific code from simple text. All languages that can be run on Windmill are supported.
Code generation
In a code editor (Script, Flow, Apps), click on AI
and write a prompt describing what the script should do. The script will follow Windmill's main requirements and features (exposing a main function, importing libraries, using resource types, declaring required parameters with types). Moreover, when creating an SQL or GraphQL script, the AI assistant will take into account the database/GraphQL API schema when selected.
The AI assistant is particularly effective when generating Python and TypeScript (Bun runtime) scripts, so we recommend using these languages when possible.
Moreover, you will get better results if you specify in the prompt what the script should take as parameters, what it should return, the specific integration and libraries it should use if any.
For instance, in the demo video above we wanted to generate a script that fetches the commits of a GitHub repository passed as a parameter, so we wrote: fetch and return the commits of a given repository on GitHub using octokit
.
Code editing
Inside the AI Gen
popup, you can choose to edit the existing code rather than generating a new one. The assistant will modify the code according to your prompt.
Code fixing
Upon error when executing code, you will be offered to "AI Fix" it. The assistant will automatically read the code, explain what went wrong, and suggest a way to fix it.
Summary copilot
From your code, the AI assistant can generate a script summary.
Windmill AI for flows
Generate Workflows from prompts.
Windmill AI for Flows support two creation modes: Sequence Flows and Trigger Flows. In both cases, you specify a prompt for each step. The AI assistant will then generate the code step by step and link them together. You will have the opportunity at the end of each step to review, edit or even regenerate the step's code.
For each action, you can either choose a script from the Hub or generate one from scratch using Windmill AI. At the end of the process, flow inputs are inferred and you just need to fill them in.
Sequence flows
Generate a flow consisting of a sequence of scripts.
Trigger flows
Trigger flows are designed to pull data from an external source and return all of the new items since the last run, without resorting to external webhooks. A trigger script is intended to be used as scheduled poll with schedules and states (rich objects in JSON, persistent from one run to another) in order to compare the execution to the previous one and process each new item in a for loop.
If there are no new items, the flow will be skipped.
The inputs of the for-loop action are automatically filled in with the outputs of the trigger step.
Moreover, the flow is automatically set to run every 15 minutes when deployed. The schedule can then be customized (e.g. every 30 seconds etc.). This allows you to avoid relying on webhooks sent by external APIs, which can be tedious to configure.
Summary copilot for steps
From your code, the AI assistant can generate a summary for flow steps.
Step input copilot
When adding a new step to a flow, the AI assistant will suggest inputs based on the previous steps' results and flow inputs.
Flow loops iterator expressions from context
When adding a for loop, the AI assistant will suggest iterator expressions based on the previous steps' results.
Flow branches predicate expressions from prompts
When adding a branch, the AI assistant will suggest predicate expressions from a prompt.
Windmill AI code completion
When code completion is enabled, Windmill AI suggests completions as you type in all code editors (Script, Flow, Apps).
CRON schedules from prompt
The AI assistant can generate CRON schedules from a prompt.
Models
Windmill AI supports natively OpenAI's GPT-4o, Anthropic's Claude 3.5 and Mistral's Codestral.
Additionnaly, you can run all Windmill AI features on a specified Azure OpenAI deployed model.
You need to specify the base path of the model in the instance settings.