What if your Jenkins could magically add helpers only when work piles up, then disappear when done?
Why Agent types (permanent, cloud) in Jenkins? - Purpose & Use Cases
Imagine you have a busy bakery where every cake must be baked by hand in the same oven, one after another.
When orders pile up, the single oven slows everything down, and you can't easily add more ovens without a lot of hassle.
Using only permanent agents in Jenkins is like having just one oven: it can get overwhelmed, and setting up new agents takes time and effort.
This causes delays, wasted resources, and frustration when many tasks need to run at once.
Agent types like permanent and cloud let Jenkins flexibly handle work.
Permanent agents are always ready, like your main oven, while cloud agents can be created on demand, like renting extra ovens only when needed.
This balance speeds up work and saves resources.
node {
// runs only on one permanent agent
stage('Build') {
sh 'make build'
}
}pipeline {
agent none
stages {
stage('Build') {
agent { label 'permanent-agent' }
steps { sh 'make build' }
}
stage('Test') {
agent { label 'cloud-agent' }
steps { sh 'make test' }
}
}
}It enables Jenkins to handle many tasks efficiently by using fixed agents for steady work and cloud agents for flexible, on-demand scaling.
A software team uses permanent agents for daily builds and spins up cloud agents to run extra tests only when a big feature is ready, saving time and money.
Permanent agents are always available but limited in number.
Cloud agents start and stop as needed, offering flexibility.
Using both types together makes Jenkins faster and more efficient.