What you mean with pause exactly?
You can pause pipeline jobs by using an input step. When this input step is outside of a node step, then no executor is consumed.
An executor is consumed as long as the node step is running, when you have an input step inside a node step, this means that the job is waiting at the input and still occupies the executor.
It is not possible to pause freestyle jobs or pause pipeline steps without an input step.
Within my multi-step pipeline, there is a stage that requires external input. I want the ability to pause the pipeline at this specific step and wait for the needed input. Once I receive the external input, I want to resume the process from the same point where it was paused. During the time when the pipeline is in a paused state, I would like to use the executor to work on other job executions, rather than having it remain idle while waiting for the input.
As explained this can be done when the input step is outside of a node. You could stash the workspace (maybe you don’t need all files but only a few, e.g. a build result you want to deploy), leave the node, wait for input, have a new node (this might not be the same node if you use labels that are served by more than 1 machine) unstash and then continue.
Also consider that in case you have concurrent execution of jobs, the run that starts while a build is waiting for input could use the same workspace that was used by the now waiting run, so you shouldn’t make any assumptions here. And when it resumes it could run in a concurrent folder (those that end with e.g. @2) on the same machine when you have more than 1 executor.
I have the same requirement.
I understand your description, but I still don’t know how to write a pipeline script to implement this requirement.
Here is my pipeline script.
Could you help me create a demo based on this? @mawinter69
The key problem in your example is that you started with agent any at the topmost level. That needs to be replaced with agent none and then each stage that needs an agent will need to declare that agent within the stage.