Interview Prep/Jenkins/Declarative pipeline syntax

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.

All Jenkins questions Roadmap: Jenkins

More on Declarative pipeline syntax