Resources and resource types
Resources are rich objects in JSON that allow to store configuration and credentials.
In Windmill, Resources represent connections to third-party systems. Resources are a good way to define a connection to a frequently used third-party system such as a database. Think of Resources as a structured way to store configuration and credentials, and access them from scripts.
Each Resource has a Resource Type (RT for short) - for example MySQL, MongoDB, OpenAI, etc. - that defines the schema that the resource of this type needs to implement. Schemas implement the JSON Schema specification.
While resources store configuration and credentials for connections, Assets track data flows and visualize datasets. Assets automatically detect when you reference S3 objects (s3://storage/path/to/file.csv
) or resources (res://path/to/resource
) directly in your code, creating a visual representation of your data pipeline. This helps you understand how data moves through your workflows and identify dependencies between different data sources.
Check our list of integrations (or, pre-made resource types). If one is missing, this very page details how to create your own.
Create a resource
To create a resource using an existing type, go to the Resources page and click "Add resource".
Just like most objects in Windmill, Resources have a path that defines their permissions - see ownership path prefix.
Each Resource has a Resource Type, that defines what fields that resource contains. Select one from the list and check the schema to see what fields are present.
Resources commonly need to access secrets or re-use
Variables, for example, passwords or API
tokens. To insert a Variable into a Resource, use Insert variable (the $
sign button) and select a Variable. The name of a Variable will look like
$var:<NAME_OF_VAR>
. When resources are called from a Script, the Variable
reference will be replaced by its value.
Resources can be assigned a description. It supports markdown.
It's a good practice to link a script template to Resources, so that users can easily get started with it. You can use markdown in the description field to add a link, for example:
[example script with this resource](/scripts/add?template=script/template/path)
Create a resource type
Windmill comes preloaded with some common Resource types, such as databases, apps, SMTP, etc. You can see the full list on Windmill Hub. You can also add custom Resource types by clicking "Add a resource type" on the Resources page.
Use the "Add Property" button to add a field to the resource type. You can specify constraints for the field (a type, making it mandatory, specifying a default, etc). You can also view the schema by toggling the "As JSON" option:
The resources types created from the Admins workspace are shared across all workspaces.