Trigger to Executor

How a Build Travels from Trigger to Executor

One Pipeline build of queue-demo takes this path through the pieces:

One Pipeline build, from trigger to build record
One Pipeline build, from trigger to build record
  1. Trigger. A click, API call, webhook, timer or upstream job queues the job with a cause attached.

  2. Queue. The item sits out the quiet period, merges with duplicates and waits while blocked.

  3. Scheduler. The load balancer gives it an idle executor whose node matches the label; for a Pipeline that is a flyweight executor on the controller, so it is instant.

  4. Run. Jenkins 8,793 takes the number from nextBuildNumber, creates builds/N/ and starts the Groovy program. Each node block goes back through steps 2 and 3 as its own queue item.

  5. Execute. The agent allocates a workspace (/home/jenkins/agent/workspace/queue-demo on agent-1) and runs the steps over Remoting. An sh step is a durable task: a detached shell writing to a file in queue-demo@tmp, which the controller polls.

  6. Record. The log streams into builds/N/log; the result lands in build.xml.

That durable-task design is what lets a long sh step outlive a controller restart, the subject of Surviving Restarts.