
Jenkins
CertifiedTasks and triggers to trigger Jenkins jobs, list historical runs, query build details, and react to completed builds.
Provide the Jenkins serverUrl with a username and API token to start parameterized builds, query job or build details, list runs with fetch/store options, or trigger flows on build completion; the tasks handle crumb headers and surface queue, status, and artifact information for orchestration.
Jenkins
Tasks and triggers to trigger Jenkins jobs, list historical runs, query build details, and react to completed builds.
Provide the Jenkins serverUrl with a username and API token to start parameterized builds, query job or build details, list runs with fetch/store options, or trigger flows on build completion; the tasks handle crumb headers and surface queue, status, and artifact information for orchestration.
tasks
How to use the Jenkins plugin
Trigger Jenkins builds, monitor their lifecycle, list historical runs, and poll for build completions from Kestra flows.
Authentication
Set serverUrl to your Jenkins instance URL, username to your Jenkins user, and apiToken to your Jenkins API token. Store credentials in secrets and set them on each task or trigger.
Tasks
JobBuild
Triggers a Jenkins job via buildWithParameters:
jobName: Name or foldered path (e.g.,team/project/job).parameters: Optional map of build parameter names to values.wait: Set totrueto block until the build finishes.waitTimeout: Maximum duration to wait before timing out (defaults toPT10M).pollInterval: Polling frequency (defaults toPT2S).cancelOnTimeout: Set totrueto cancel the queued item or stop the build on timeout.allowedStatuses: List of acceptableBuildResultvalues whenwaitis true (defaults to[SUCCESS]). Outputsstatus,queueId,buildNumber,buildUrl,result, andinfo.
JobInfo
Fetches details about a specific build:
jobName: Name or foldered path.buildNumber: Build number (e.g.,"1") or alias (lastBuild,lastSuccessfulBuild, etc.). Defaults to"lastBuild". Outputsnumber,url,result,building,duration,timestamp, andinfo.
ListBuilds
Lists historical builds from the Jenkins job API tree:
jobName: Name or foldered path.fetchType:FETCH(inline list),FETCH_ONE(first item), orSTORE(internal storage file).result: Optional filter byBuildResult(SUCCESS,UNSTABLE,FAILURE,NOT_BUILT,ABORTED).since: Optional timestamp filter.max: Maximum builds to return (1-100, defaults to50). Outputsbuilds,build,uri, andsize.
Triggers
Trigger
Polling trigger that evaluates Jenkins builds for a specific job:
jobName: Name or foldered path.interval: Polling interval (defaults toPT1M).result: Optional filter byBuildResult.initialBuildNumber: Optional starting build number to avoid re-firing older runs. Tracks progress using a length-prefixed SHA-256 watermark in the namespace KV store to guarantee exactly-once firing, holding back evaluations until all lower in-progress builds complete. OutputsbuildNumber,buildUrl,result,duration,timestamp,fullDisplayName, andbuilds.