Trigger a Build and Await the Result
A 4-step recipe with Jenkins. We can help you get access.
Recipe · 4 steps
Trigger a Build and Await the Result
with Jenkins · Continuous Integration Management
Trigger a Jenkins job and block until the resulting build completes.
- Read the job to confirm it exists, that it is buildable, and to capture the number the next build will be assigned.
- Post the build trigger for the parameterless job. Jenkins responds 201 with a Location header pointing at the newly created queue item.
- Read the build queue to confirm the trigger was accepted and to see whether the build is still waiting for an executor.
- Poll the build resource until Jenkins reports it is no longer building, then capture the final result. Retries allow time for the build to leave the queue, start on an executor, and run to completion.
What you'll need to have ready
- jobName: The name of the Jenkins job to build (e.g. "my-pipeline").
- token: Optional remote build trigger token configured on the job, required when the job is set up for authenticated remote triggering.
For your developer
Arazzo workflow jenkins:trigger-build-and-await-result, 4 operations: getJob → triggerBuild → getQueue → getBuild. Specs on APIs.io.