Stage-level `input` directive vs the `input` step: what is the difference?
AdvancedConceptDeclarative pipeline syntax
Answer
The directive is evaluated before the stage's agent is allocated, so no executor or pod is held while waiting. The step (input message: '...' inside steps or script) runs wherever it is called; inside an agent block it keeps the executor busy (and the pod alive) for the whole wait. The step returns a value you can assign in script {}; the directive exposes parameters as env vars. For approvals, prefer the directive plus agent none at the top, and always a timeout.
More on Declarative pipeline syntax
What is the minimum valid declarative pipeline?BeginnerWhat agent types exist in declarative pipelines?IntermediateWhen do you use `agent none` at the top level?IntermediateHow do nested sequential stages work and why are they useful?IntermediateList the `post` conditions and when each fires.IntermediateWhat are the most useful `when` conditions?Intermediate