New to Kestra?
Use blueprints to kickstart your first workflows.
Drive a patch wave from the ServiceNow CMDB with Kestra: query CIs due for patching, run a runbook per server, and update each CMDB record in sync.
Make the ServiceNow CMDB the single source of truth that drives your patch waves. This blueprint queries the configuration items flagged as due for patching, runs your patch runbook against each one, and writes the outcome back to the CMDB so inventory always reflects what was actually patched. Instead of maintaining a separate patch list that drifts from reality, the CMDB defines the scope, controls concurrency, and stays continuously reconciled. This closes the gap between change management records and the servers in the field, giving infrastructure and platform teams an auditable, repeatable patch cycle triggered by their own change window.
io.kestra.plugin.core.trigger.Webhook trigger (on_patch_window) to start the wave.list_cis (io.kestra.plugin.servicenow.Get) queries the cmdb_ci_server table using the encoded ci_query input with fetchType: FETCH to pull the CIs due for patching.patch_each_ci (io.kestra.plugin.core.flow.ForEach) iterates over outputs.list_cis.results with a concurrencyLimit of 2, capping how many servers patch at once.run_patch (io.kestra.plugin.core.flow.Subflow) runs the patch runbook named by patch_runbook_id with wait: true, so the wave blocks on each runbook completing.update_ci (io.kestra.plugin.servicenow.Update) records the patch on the CI by sysId, clearing u_patch_due, stamping u_last_patched with now(), and adding work_notes referencing the Kestra execution.id.ServiceNow can flag CIs and fire a webhook, but it is not built to fan out a runbook across servers, gate concurrency, retry a failed host, and reconcile state in one declarative flow. Kestra adds event-driven triggering, per-task retries, end-to-end lineage from CI selection through patch to CMDB write-back, and a single YAML definition you can version in Git. The ForEach concurrency control and Subflow wait semantics give you orchestration the CMDB's own scheduler cannot provide.
company.team namespace to call per CI.cmdb_ci_server carrying a patch-due flag your ci_query can match.SN_DOMAIN: ServiceNow instance domain.SN_USERNAME: ServiceNow API username.SN_PASSWORD: ServiceNow API password.SN_PATCH_WEBHOOK_KEY: key guarding the webhook trigger.ci_query input to match how your CMDB flags patch-due servers.patch_runbook_id at the flow that performs the patch.u_patch_due and u_last_patched to your own CMDB schema fields.concurrencyLimit to tune rollout speed and blast radius.