List managed devices, policy packages and firewall addresses, keep address objects in a declared state and install policy packages on FortiManager from any Windmill script, flow or app.
Set up in 3 steps
Create a REST API Admin
On the FortiManager (7.2.2 or later), go to System Settings > Administrators > Create New > REST API Admin. Give it an admin profile scoped to what your flows need, set JSON API access to Read or Read-Write, restrict trusted hosts to your Windmill workers' addresses, and copy the generated API key. It is shown only once.
Add the resource
In Windmill, open Resources, add a FortiManager resource, and enter the FortiManager's HTTPS address and the API key. If the FortiManager uses a private CA, trust that CA on your workers. The scripts never disable certificate checks.
Run your first script
Start with List devices on your ADOM (root if ADOMs are disabled). Upsert firewall address runs as a dry run by default and returns the diff; set dry_run to false to apply it.
Scripts
Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.
Resource type
The shape of the credential every script on this page expects.
fortimanager
View raw schema →| Field | Type | Required | What it is |
|---|---|---|---|
| base_url | string | Yes | HTTPS address of the FortiManager, e.g. https://fortimanager.example.com (add :port if not 443). No trailing slash. The certificate must match this address and be trusted by the Windmill worker (DENO_CERT or SSL_CERT_FILE): a default self-signed certificate is rejected. |
| token | string | Yes | API key of a REST API Admin with JSON API access set to Read or Read-Write (System Settings > Administrators > Create New > REST API Admin). Sent as a Bearer token. |
Questions
How do I install a package and wait for the result?
Install policy package returns a task id right away. In a flow, follow it with Get task status in a loop until percent reaches 100. The install succeeded when num_err is 0, and line holds the per-device results.
My ADOM uses workspace mode. Will the write scripts work?
Writes to a workspace-mode ADOM need the ADOM locked first and committed after. The shipped scripts don't lock, so add the lock and commit steps around them. Install policy package also exposes FortiManager's auto_lock_ws install flag.
Is my API key stored on the hub?
Never. It lives only in your own Windmill workspace, encrypted at rest.