When enabled, the Docker Swarm service backing this agent is removed
immediately after the agent finishes a single Jenkins build, instead of
being kept alive for the idle timeout window.
Useful when you need a guaranteed-clean filesystem and process state
per build (for example, security-sensitive jobs or workloads that
leak temporary state).
Trade-offs:
- Each build pays the full container provisioning cost (image pull
+ agent connection handshake), which adds tens of seconds to
queue time.
- Number of Executors must be set to
1. The
one-shot retention strategy terminates the agent after the
first build completes, which would abort any other build still
running on a second executor.
- If a parent template (referenced via Inherit From) has
this option enabled, child templates inherit it and cannot
disable it.