Hi! I'm your Kestra AI assistant. Ask me anything about workflows.
EXAMPLE QUESTIONS
How to trigger a flow after another one?
What is a task runner?
How to set up CI/CD for kestra flows?
Let NetBox decide what runs where.
List devices from NetBox by site, role, or tag and run Ansible against them. Auto-allocate IPs from a prefix when a new VM provisions. Reconcile network scan reality with declared inventory weekly. Manage device and contact assignment lifecycle as flow steps, with NetBox as the source of truth.
Make NetBox the inventory source of truth for every flow with an orchestration engine that lists devices by site/role/tag, allocates IPs from prefixes on VM provision, handles drift reconciliation between scan reality and declared inventory, and chains NetBox with Ansible, Proxmox, and ServiceNow. Drop the static hosts file; cut drift detection from quarterly to weekly.
device.List filtered by role and site, ForEach playbook, rollup to Slack
Open blueprint
Proxmox VM created, NetBox allocates IP, device registered, owner assigned
Open blueprint
Weekly reconciliation flow between network scan and NetBox state
Open blueprint
Around every device, every prefix, every site.
NetBox holds the inventory. Kestra reads it to drive automation, writes back to keep it current, and reconciles it against reality on a schedule. The static Ansible inventory file, the IP spreadsheet, and the who-has-which-rack tribal knowledge all go away. NetBox is the source of truth, flows are the consumers.
Device lists feed the ForEach, no static inventory file
device.List fetches devices from NetBox with filters on site, role, tag, status, and custom fields. fetchType STORE writes large results to internal storage for thousand-device fleets, FETCH keeps small results in memory. A ForEach iterates the result and runs Ansible, Terraform, or any plugin task per device using the device's primary IP from NetBox. The static inventory file disappears, NetBox is the inventory.
IPAM allocates from a prefix on demand
ipam.AssignIpAddress creates an IP address and assigns it to a device or VM interface. Provide an explicit address, or a prefixId to let NetBox allocate the next available from the prefix. Tags and custom fields stamp the allocation with the requesting flow's execution ID for audit. The static spreadsheet of who-has-which-IP disappears, NetBox tracks every allocation.
Device records created and patched alongside reality
device.Create posts a new device with type, role, site slugs, optional rack, position, face, status, tags, and custom fields. device.Update applies PATCH by default (partialUpdate true), or PUT when disabled. The flow that provisions a VM in Proxmox or vSphere also registers it in NetBox. The flow that decommissions removes it. Reality and the declared inventory stay aligned automatically.
Site enumeration drives per-site flows
site.List enumerates every site in NetBox with optional filters. A ForEach over the result runs per-site flows: backup verification per DC, patch waves per region, audit reports per facility. Adding a new site is a NetBox edit, not a flow refactor or a CI variable update.
Contact assignment automation
contactassignment.Create posts a contact assignment linking a contact and role to a resource object (device, site, VM, circuit, IP) by content type and object ID. Priority accepts primary, secondary, tertiary, or inactive. Use to keep on-call ownership in sync with the rotation, auto-assign vendor contacts to new circuits, or attach a billing owner to every device on provision.
Drift reconciliation between reality and declaration
A weekly reconciliation flow runs a network scan (LLDP discovery, SNMP, or hypervisor API), pulls NetBox state via device.List, and diffs the two. Devices in reality but not NetBox auto-create with a review-needed tag. Devices in NetBox but missing from reality open a GitHub issue for the responsible team. The inventory stays trustworthy without manual audits.
How network teams use NetBox and Kestra
Patterns network and platform teams run in production today. Each one shows the flow end to end, with the real plugin classes in play.
Inventory-driven
Run Ansible against every edge router in DC-2
device.List filters by role: edge-router, status: active, site: dc-2. A ForEach iterates the result and runs an Ansible playbook against each device, addressing it by the primary IP from NetBox. Per-device results are captured via the Kestra Ansible callback. A single rollup posts to Slack with success counts, failure details, and links to the per-device executions. The static Ansible inventory file goes away.
Inventory lives in NetBox, not in a YAML file
Adding a device is a NetBox edit. The next flow run picks it up automatically. No PR to the inventory file, no merge conflicts.
Filter granularity matches your operational shape
Filter by role, site, status, tag, or a custom field. The same flow definition handles a 4-device set or a 400-device set, scoped by the device.List filter.
Per-device retries inside the ForEach
If one device hits a transient SSH failure, only that ForEach iteration retries. The other devices keep moving.
Rollup shows what worked, what did not, where
The Slack message links to per-device executions and lists by site or role which devices need follow-up.
monthly maintenance
schedule
device list
filtered by role + site
ForEach device
per host
ansible playbook
addressed by primary IP
aggregate
per-device results
notify
Slack rollup
IPAM
Allocate an IP from a prefix when a new VM provisions
A Proxmox or vSphere VM creation flow needs an IP for the new guest. The flow calls ipam.AssignIpAddress with a prefixId for the target subnet; NetBox allocates the next available IP and tags the allocation with the requesting execution ID. The flow configures the VM's network with the allocated IP. device.Create registers the VM in NetBox with the IP record linked. No spreadsheet, no Slack ping for an IP.
Prefix-based allocation, no manual picking
Pass a prefixId, NetBox returns the next available IP from that subnet. The flow does not need to know which IPs are taken.
Allocation tagged with execution ID
The IP record's tags include the Kestra execution ID, so an audit later answers exactly which flow run claimed which IP.
Device registration and owner assignment chained
The same flow that allocates the IP also registers the device and assigns the billing or on-call owner via contactassignment.Create.
vm request
form or webhook
create vm
Proxmox or vSphere
allocate ip
from prefix
configure network
assign IP to guest
register device
device.Create
assign owner
contactassignment.Create
Operations
Site-by-site patch wave with per-site Slack rollup
Monthly patch wave. site.List returns every active site (filtered by tenant, region, or tag). Per site, device.List filters by role and status. A nested ForEach runs the patching subflow per device with site context, snapshot before patch, health probe after. Per-site rollup posts to that site's Slack channel. One flow handles dozens of sites and thousands of devices.
Site cardinality drives the outer loop
Adding a site to NetBox extends the flow's coverage automatically. No flow edit, no schedule update.
Per-site Slack channel from NetBox metadata
Each site's Slack webhook is stored as a NetBox custom field. The flow reads it per iteration and posts to the right channel.
Concurrency control caps blast radius
ForEach concurrencyLimit ensures only N sites are patched at once, so a region-wide failure does not roll across the world.
monthly window
schedule
list sites
active only
ForEach site
with concurrency
list devices
per site, by role
patch subflow
snapshot + patch + verify
per-site rollup
site-specific Slack
Audit
Weekly reconciliation: scan reality, diff NetBox, alert on drift
Weekly flow. A network scan (LLDP discovery, SNMP poll, or hypervisor API) returns the actual device list. device.List returns the NetBox declared list. A diff task computes additions (devices in reality but not NetBox) and deletions (devices in NetBox but missing from the scan). Additions auto-create with a review-needed tag for the network team to confirm. Deletions open a GitHub issue against the responsible team's repo.
Drift surfaces before it bites
Stale inventory is the number one cause of automation failures. Weekly reconciliation catches it inside a week.
Additions get a review-needed tag
Auto-created devices are not silently trusted. A review tag flags them for the network team's next standup.
Deletions open a GitHub issue
A device missing from the scan is a real incident: hardware failure, decommission, or misconfigured scan. The issue routes to the team that owns it.
weekly schedule
cron
scan reality
LLDP / SNMP / hypervisor
netbox state
device.List
diff
additions, deletions
auto-create new
with review tag
issue for missing
GitHub
report
Slack summary
Kestra vs NetBox automation alternatives
Capability
pynetbox in custom Python scripts
NetBox Webhooks + Lambda glue
Ansible netbox.netbox collection
Device list with filters as a flow task
device.List with site/role/tag/status filters, fetchType STORE for large fleets
pynetbox API calls, parsing in Python
Not in scope, webhooks fire outward
netbox_inventory plugin generates a static file
IPAM allocate from prefix on demand
ipam.AssignIpAddress with prefixId, tags include execution ID
pynetbox + custom retry
Out of scope
netbox_ip_address with first_available query
Device lifecycle (Create + Update) chained with provisioning
device.Create / device.Update as flow tasks alongside Proxmox/vSphere
Custom Python pipeline
Webhook-driven, no provisioning chain
netbox_device tasks in a playbook
Site enumeration drives per-site flows
site.List + ForEach with concurrency control
Custom Python loop
Not native
Static inventory per site
Contact assignment automation
contactassignment.Create as a flow task
pynetbox call
Not native
netbox_contact_assignment module
Drift reconciliation against scan reality
Scan + device.List + diff in one flow definition
Custom comparison script
Webhook listener cannot reconcile from scan
Inventory plugin + manual diff
Approval gate before destructive NetBox changes
Pause + resume, named reviewer logged
Custom approval logic
Not native
Manual playbook gate
Chain NetBox with Ansible, Terraform, Proxmox, vSphere
Outputs flow into any plugin task
Custom glue code
Multiple webhook + Lambda hops
Ansible-centric, no Terraform chain
Self-hosted, air-gapped, OSS edition
Self-hosted by default, NetBox plugin available in Enterprise
Self-hosted
Self-hosted + cloud Lambda
Self-hosted
NetBox & Kestra: common questions
Find answers to your questions right here, and don't hesitate to Contact Us if you couldn't find what you're looking for.
A static Ansible inventory file or a per-team CSV is the number one cause of automation failures: it gets stale, it gets edited inconsistently, it lives in a repo that no one updates. NetBox is built to be the source of truth for inventory, with relationships between devices, sites, racks, prefixes, IPs, and contacts. Driving flows from NetBox means adding a device to inventory is one place (NetBox), and every automation that touches that device picks it up automatically on the next run.
No. The io.kestra.plugin.ee.netbox plugin is part of Kestra Enterprise. The open-source edition includes nearly every other Kestra plugin (1300+), and you can call the NetBox REST API from the OSS edition via io.kestra.plugin.core.http.Request, but you lose the typed task shape (device.List with filters, ipam.AssignIpAddress with prefix allocation, etc.) and end up writing more YAML to handle pagination and response parsing.
NetBox API tokens. Create a token in the NetBox UI under Admin > API Tokens, scoped to a service user with the minimum required permissions: dcim.view_device for listing, dcim.add_device for creating, ipam.add_ipaddress for allocation, and so on. Store the URL and token in Kestra's secrets backend and reference via pluginDefaults on io.kestra.plugin.ee.netbox so every task picks them up without repeating credentials.
Yes. device.List filters accept custom field queries via the standard NetBox query parameter syntax. device.Create and device.Update accept a customFields object with the field slugs as keys. Use custom fields for the Slack channel webhook per site, the on-call rotation per device, the cost center per rack, or anything else your team has modeled in NetBox.
ipam.AssignIpAddress accepts either an explicit address (e.g. 10.0.1.42) or a prefixId. When prefixId is provided, NetBox allocates the next available IP from that prefix and returns the assigned address in the task output. Use tags and custom fields on the allocation to track the requesting flow's execution ID, the target device, or any other audit metadata. The flow does not need to know which IPs are taken.
A scheduled flow runs a network scan (LLDP discovery, SNMP poll, vCenter API, Proxmox API, or a cloud provider API), reads the corresponding NetBox state via device.List, and diffs the two by device name or serial number. Devices in reality but missing from NetBox auto-create via device.Create with a review-needed tag for the network team to confirm. Devices in NetBox but missing from the scan open a GitHub issue against the team that owns them. The inventory stays trustworthy without manual audits.
Yes. Kestra ships self-hosted on Docker or Kubernetes and runs fully air-gapped. The NetBox plugin reaches NetBox over HTTPS, so the only network requirement is that the Kestra workers can reach the NetBox URL inside your network. Use the trusted CA properties on Kestra's HTTP tasks if your NetBox uses an internal CA. See Kestra for infrastructure automation for the broader self-hosted picture across NetBox, Ansible, Proxmox, and the rest of the stack.
NetBox is the inventory source of truth. Ansible configures the devices NetBox knows about. Terraform provisions the underlying infrastructure those devices live on. Kestra chains them: device.List feeds the Ansible ForEach, ipam.AssignIpAddress assigns IPs that Terraform's network resources will reference, and device.Create writes back the provisioned resources to NetBox. One execution history across inventory, provisioning, and configuration.
Ready to drive flows from NetBox as your inventory truth?
Run Ansible against every device of a role, allocate IPs from prefixes on VM provision, run patch waves site by site, and reconcile reality with declared inventory weekly. Kestra Enterprise plugin, self-hosted, event-driven.