When do you use `agent none` at the top level?
IntermediateConceptDeclarative pipeline syntax
Answer
When stages need different agents (Linux build, Windows test, deploy pod with a special service account) or when the pipeline has an input step that may wait for hours. With agent none, the approval stage holds no executor and no pod. The trade-off: each stage with its own agent gets a separate workspace, so pass files with stash/unstash or artifacts, or group stages under a parent stage that owns the agent.
More on Declarative pipeline syntax
What is the minimum valid declarative pipeline?BeginnerWhat agent types exist in declarative pipelines?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?IntermediateWhat do `beforeAgent`, `beforeInput` and `beforeOptions` do inside `when`?Advanced