New to Kestra?
Use blueprints to kickstart your first workflows.
Scheduled Kestra flow that polls the ServiceNow Table API for new incidents, tracks a KV Store cursor, and launches a remediation subflow per ticket.
Turn a ServiceNow incident queue into an automated remediation pipeline. This Kestra blueprint scans your ServiceNow instance on a schedule, uses the KV Store as an incremental cursor so every incident is processed exactly once, and launches one subflow execution per new ticket. Each ticket becomes its own execution with its own logs, retries, and status, so a single stuck remediation never blocks the rest of the queue.
every_15_minutes trigger (io.kestra.plugin.core.trigger.Schedule) starts a scan every 15 minutes.lastCheckDate task (io.kestra.plugin.core.kv.Get) reads the serviceNowLastPollDate cursor from the KV Store, tolerating a missing key on the very first run.formatTimestamp task (io.kestra.plugin.core.debug.Return) rewrites the cursor into a gs.dateGenerate fragment that the ServiceNow query encoder accepts.fetchOpenTickets task (io.kestra.plugin.core.http.Request) calls the ServiceNow Table API for incidents in state 1 (New) created after the cursor, authenticated with a basic auth token and capped at 100 records per scan. taskCache avoids refetching identical queries.getTicketDetails task (io.kestra.plugin.core.flow.ForEach) iterates the result array and the nested processTicket task (io.kestra.plugin.core.flow.Subflow) launches servicenow-incident-ansible-remediation with the ticket number, short description, open date, sys_id, and category.updateLastCheckDate task (io.kestra.plugin.core.kv.Set) advances the cursor to now, in UTC, so the next scan only sees newer tickets.A cron job that polls ServiceNow gives you no per-ticket visibility, no retry semantics, and a cursor stored in a fragile local file. Kestra gives you a declarative schedule, a durable KV Store for the incremental cursor, fan-out to isolated subflow executions, and a UI where each ticket's remediation can be inspected, retried, or replayed independently. The parent scan and each child remediation are linked in the execution graph, so lineage from queue to fix is automatic.
incident table.servicenow-incident-ansible-remediation flow deployed in the same namespace.serviceNowInstance variable to your instance name (the your-instance part of your-instance.service-now.com).SERVICENOW_TOKEN: base64-encoded user:password pair used as the basic auth token for the Table API.SERVICENOW_TOKEN secret to your Kestra namespace.serviceNowInstance variable with your real instance name.sysparm_query to a specific assignment group, priority, or CI class.sysparm_limit and add pagination for high-volume queues.io.kestra.plugin.core.flow.Switch task before the fan-out.concurrencyLimit on the ForEach to throttle how many remediations run at once.io.kestra.plugin.core.trigger.Webhook trigger fed by a ServiceNow Business Rule outbound REST call.