The Input Step in Jenkins

The Input Step in Jenkins

Learn how to make an automated pipeline stop, ask a human a question, and carry on only when the answer arrives: approvals, choices and sign-offs explained from the first idea to safe production habits.

Automation is wonderful until the moment a decision needs a human being. Should this release go to real customers today? Which version should be rolled back? Has the quality team finished checking the new screen? A machine can run a thousand commands in a minute, but it cannot know that the marketing team asked to hold the launch until Thursday.

Jenkins solves this with a small but powerful feature called the input step. It lets a pipeline pause in the middle of its work, show a question to a person, and wait. When the person clicks Proceed, the pipeline continues. When the person clicks Abort, the pipeline stops. It can even collect answers, such as a version number or an environment name, and hand them to the steps that follow.

This guide assumes you know nothing about it. Every new word is explained when it first appears, everyday pictures make the ideas easy to hold, and the later chapters move into the details that experienced engineers rely on in production: waiting without wasting machines, setting time limits, choosing who may approve, avoiding traps, and keeping an audit trail.

1What Is the Input Step?

A plain-language first look before any details.

Jenkins is a free, open-source automation server that builds, tests and delivers software. Its work is written as a pipeline, a recipe stored in a text file called the Jenkinsfile. A pipeline is split into stages, such as Build, Test and Deploy, and each stage contains steps, the single actions Jenkins performs.

The input step is a step whose action is to wait for a person. When the pipeline reaches it, Jenkins freezes the run at that exact point, shows a message to the people allowed to answer, and does nothing else until someone responds. It comes from a plugin named Pipeline: Input Step, which is included in almost every Jenkins installation that uses pipelines.

Everyday Analogy

Picture an airport security gate. Luggage rolls along a belt automatically, but before it enters the aircraft a guard must look at the screen and press a green button. The belt stops and waits. The guard can press green to let it through or red to stop it. The input step is that guard’s button placed inside your pipeline.

What a person sees

On the page of the running build, Jenkins shows a paused notice with your message and two buttons. The Proceed button is green and can carry your own label, such as “Deploy to production.” The Abort button ends the run. If you asked for extra answers, form fields appear above the buttons.

i
Remember

The input step is about human decisions, not machine decisions. If a computer could make the choice using a rule, such as “tests passed, so continue,” a normal condition is usually better than asking a person.

Many organizations, especially those in finance, healthcare and government, must show that a person approved a change before customers saw it. Others simply want a safety net before a risky action such as a database change. In all of these cases the input step turns “somebody should look at this” from a hallway conversation into a recorded, enforced part of the pipeline.

2Why the Input Step Exists

The problem it solves and the two styles of delivery it supports.

The problem: fully automatic is not always wanted

Early automation aimed to remove people completely. Reality is more nuanced. Some changes are risky, some depend on business timing, and some need a legal or safety review. If the pipeline cannot pause, teams invent awkward workarounds: they split one pipeline into two jobs and remember to start the second by hand, they send emails and hope someone replies, or they leave the last step commented out and ask an engineer to uncomment it. All of these are easy to forget, impossible to audit, and slow.

Continuous delivery and continuous deployment

Two phrases matter here. Continuous delivery means every change is always kept in a state that could be released, but a human chooses the moment. Continuous deployment goes one step further: every change that passes the tests goes to customers automatically, with no human in the middle. The input step is the natural tool for continuous delivery. It marks the exact place where the machine hands over to a person.

1

Manual releases

Engineers followed written instructions and typed commands. Slow, error-prone and hard to repeat.

2

Split jobs

One job built the code and a second job, started by hand, deployed it. Better, but the link between them was easy to break.

3

Pipeline as code

Jenkins Pipeline, made a headline feature by Jenkins 2.0 in 2016, described the whole flow in one file.

4

Human gate inside the pipeline

The input step let a single pipeline pause for a decision and continue afterwards, with the approver recorded in the log.

5

Declarative input directive

Declarative Pipeline later added an input directive at stage level, so the gate can be written as part of a stage’s structure.

2
buttons: Proceed and Abort
6
main options to shape the prompt
0
agents that should be held while waiting
Automate everything a machine can decide, and pause only for what a human should.

3Core Concepts You Need First

A handful of small ideas that make the rest easy.

Controller, agent and executor

Jenkins has a main brain, the controller, which schedules work and serves the web pages. The machines that really run your commands are agents. Each agent has a limited number of executors, which are slots for running one job at a time. Think of executors as cooking stations in a kitchen: there are only so many, and while one cook occupies a station nobody else can use it.

Build result

Every run finishes with a result: success, unstable, failure or aborted. When a person presses Abort on an input prompt, the run ends as aborted, shown in gray.

Approver, or submitter

The person who answers the prompt is called the submitter in Jenkins. You can restrict who is allowed to answer by naming users or groups. If you say nothing, any signed-in user with permission to build the job may answer.

Parameters

A parameter is a named question with a typed answer, such as a piece of text, a yes-or-no box, or a choice from a list. The input step can ask for parameters and give the answers back to the pipeline.

Input ID

Each prompt has an id, a short unique label. Jenkins uses it to build web addresses for the Proceed and Abort actions. If you do not choose one, Jenkins generates it for you.

TermSimple meaningWhy it matters for input
ControllerThe main Jenkins serverHolds the paused run and shows the prompt
AgentA worker machineShould not be occupied while waiting
ExecutorA work slot on an agentWaiting inside one wastes it
SubmitterThe person who answersRecorded in the log for audit
ParameterA typed questionLets the human steer later steps
IdUnique prompt labelUsed in approval links
AbortedStopped resultWhat happens when someone refuses or time runs out

4Architecture and Components

Which parts of a Jenkins setup take part when a run waits for a person.

The input step is not a separate service. It lives inside the pipeline engine. When it runs, the engine records “this run is waiting for input” and stops advancing that run. The run is saved on the controller’s disk, so it can survive a controller restart and resume waiting afterwards. Meanwhile the controller keeps serving other builds normally.

flowchart LR
    DEV["Developer pushes code"] --> SCM["Source Control Server"]
    SCM -->|"webhook"| CTRL["Jenkins Controller"]
    CTRL --> ENG["Pipeline Engine"]
    ENG --> ST1["Build and Test stages"]
    ST1 --> INP["Input Step: run pauses"]
    INP --> UI["Build page: Proceed or Abort"]
    INP -->|"link and message"| NOTI["Chat and Email Services"]
    NOTI --> APP["Approver"]
    APP -->|"clicks Proceed"| UI
    UI -->|"resume"| ENG
    ENG --> ST2["Deploy stage"]
    UI -->|"clicks Abort"| END["Run ends as aborted"]
Figure 1: The run pauses at the input step and resumes when an approver responds.

Read the diagram from left to right. A developer pushes code, and a webhook, which is an automatic message from one system to another, wakes the controller. The pipeline engine runs the early stages, then reaches the input step. The run pauses. A link and message are sent through chat or email, an approver opens the build page, and clicks Proceed or Abort. Proceed tells the engine to resume and run the Deploy stage. Abort ends the run.

Brain

Controller

Stores the paused run, serves the prompt page and checks who is allowed to answer.

Engine

Pipeline Engine

Executes stages in order, and freezes the position of the run at the input step.

Plugin

Input Step Plugin

Provides the step, the prompt page, the Proceed and Abort actions and the parameter forms.

Person

Approver

A signed-in Jenkins user who reads the message, chooses and clicks. Their name is recorded.

Messenger

Notification Tools

Chat and email plugins tell approvers that a decision is waiting, with a direct link.

Memory

Build Record

Keeps the log line showing who approved and what values were entered.

5Two Ways to Write It: Step and Directive

The same idea appears in two shapes in a Jenkinsfile.

The input step

The step form is placed among the other steps inside a stage. It runs when the pipeline reaches that line. It can return the answers given by the person, which you can keep in a variable and use in later steps. Because it is a normal step, you can place it anywhere, including inside conditions, loops or a timeout wrapper.

The input directive

The directive form is placed at stage level, next to the stage’s other structural settings, and belongs only to Declarative Pipeline. It pauses the stage before the stage’s steps begin. The answers are made available to the stage as environment variables named after each parameter. The directive form is tidy and readable, and it has an important advantage: it pauses before an agent is assigned, so no executor is held during the wait.

QuestionInput stepInput directive
Where is it written?Inside the steps of a stageAt stage level, beside agent and options
Available inDeclarative and Scripted pipelinesDeclarative only
Answers come back asA returned value, kept in a variableEnvironment variables inside that stage
Executor while waitingHeld if placed inside an agent blockNot held; the pause comes before the agent
FlexibilityCan sit inside loops and conditionsSimple, one gate per stage
Best forCustom flows and several promptsClean approval gates before a stage

The order inside a stage

When the directive is used, a stage is prepared in a fixed order: options are applied first, then the input prompt appears, then the agent is allocated, and finally the stage’s when rule is checked unless you chose to check it earlier. This order is the reason a stage-level timeout defined in the options also limits how long the prompt may wait.

i
Rule of thumb

For a simple “approve before deploying” gate in a declarative pipeline, prefer the directive. Use the step form when you need to ask several questions, ask conditionally, or run custom logic based on the answer.

6The Options in Depth

Six settings shape every prompt.

Required

message

The text shown to the approver. Write it as a clear question with the key facts: what will happen, where and which version.

Optional

id

A short unique label for this prompt. It appears in the approval web address, so choose something stable and readable, such as deploy-to-production.

Optional

ok

The label of the green button. The default is Proceed. A specific label like “Release to customers” reduces accidental clicks.

Optional

submitter

A comma-separated list of user names or group names allowed to answer. Everyone else is blocked from proceeding.

Optional

submitterParameter

The name of a variable that receives the approver’s user name, so later steps can record or check who approved.

Optional

parameters

A list of typed questions to show above the buttons, such as a version, an environment or a yes-or-no box.

Writing a good message

The message is the most important option and the most often neglected. A message such as “Continue?” forces the approver to open logs to understand what they are approving. A good message is short but complete. It names the service, the version, the target environment and, if useful, the link to the test report. The approver should be able to decide in ten seconds without opening anything else.

Weak versus strong messages

Weak: “Continue?” Strong: “Release version 4.12 of the booking service to the production environment? All 812 tests passed and the staging check was signed off this morning.” The second version gives the approver everything needed and leaves a clearer record later.

!
Common confusion

The submitter option restricts who may proceed. It is not the same as saying who can see the build. People with read access can still view the prompt; they simply cannot answer it.

7Parameters and Return Values

How a human answer flows back into the pipeline.

An input prompt can ask for typed answers. The kinds of questions match those used for ordinary build parameters in Jenkins, so anyone who has seen a “Build with Parameters” page will feel at home.

Parameter typeWhat the person seesTypical use
StringA single-line text boxVersion number or ticket reference
TextA multi-line text boxRelease notes or a reason for the change
BooleanA tick box“Also run the database migration?”
ChoiceA drop-down listTarget environment such as staging or production
PasswordA hidden text boxA one-time value; avoid where possible

What the step returns

The value that comes back depends on how many questions you asked.

  • No parameters: nothing useful comes back. Success of the step simply means “the person clicked Proceed.”
  • One parameter: the step returns that single answer directly, such as the chosen environment.
  • Several parameters: the step returns a small lookup table, called a map, with one entry per parameter name.

Passing answers onward

In the step form, you keep the returned value and use it in later steps of the same pipeline. In the directive form, each answer becomes an environment variable available to all steps in that stage. If a later stage needs the value too, copy it into a variable defined earlier in the pipeline.

flowchart LR
    Q["Prompt with questions"] --> A1["String: version"]
    Q --> A2["Choice: environment"]
    Q --> A3["Boolean: run migration"]
    A1 --> M["Answers collected"]
    A2 --> M
    A3 --> M
    M --> S1["Deploy steps use version and environment"]
    M --> S2["Optional migration step runs if ticked"]
Figure 2: Several answers from one prompt steer different later steps.
i
Design tip

Prefer choices over free text wherever you can. A drop-down cannot contain a typo, and a typo in an environment name at deployment time is a very expensive kind of mistake.

8Internal Working and Lifecycle

What Jenkins actually does, from reaching the prompt to resuming.

flowchart TD
    A["Pipeline reaches input"] --> B["Engine saves the run position"]
    B --> C["Run shows Paused for Input"]
    C --> D{"Who responds?"}
    D -->|"Allowed approver clicks Proceed"| E["Answers validated and stored"]
    D -->|"Approver clicks Abort"| F["Run ends as aborted"]
    D -->|"Nobody within the time limit"| G["Timeout stops the run as aborted"]
    D -->|"Unauthorized user tries"| H["Request is refused"]
    H --> C
    E --> I["Log shows: Approved by user"]
    I --> J["Engine resumes next steps"]
Figure 3: The full lifecycle of an input prompt.
1

Reach the prompt

The engine arrives at the input step or directive. It records exactly where the run stands.

2

Pause and persist

The run is written to disk in a paused state. If the controller restarts during the wait, the run comes back and keeps waiting rather than being lost.

3

Show the prompt

The build page and the stage view display “Paused for Input” with your message, buttons and any parameter fields.

4

Check permission

When someone clicks, Jenkins verifies that the user may answer. If a submitter list exists, the user must be in it.

5

Proceed or abort

Proceed stores the answers and resumes. Abort ends the run and marks it gray.

6

Record

The log notes who approved. This line is the audit evidence many teams rely on.

Notice that while the run waits, nothing is executing. The pipeline is simply a saved position and a web form. This is why a prompt can wait for hours or days without using processing power, provided you have not placed the wait on an agent, which the next chapter explains.

9Never Hold an Executor While Waiting

The single most important habit for using input well.

Remember executors, the work slots on agents. When a stage runs on an agent, it occupies one executor until the stage ends. If an input prompt is placed inside that stage, the executor stays occupied for the whole wait, even though nothing is running. If the approver takes until tomorrow morning, an expensive machine slot sits idle overnight.

Everyday Analogy

Imagine a restaurant table booked for a party, but the party stands outside waiting for a friend. The table sits empty while other guests queue. The sensible way is to let the party wait in the lobby and be seated only when everyone has arrived. Waiting outside an agent is the lobby.

flowchart LR
    subgraph BAD["Wasteful design"]
        B1["Agent allocated"] --> B2["Build and test"]
        B2 --> B3["Input waits while agent is held"]
        B3 --> B4["Deploy steps"]
    end
    subgraph GOOD["Efficient design"]
        G1["Agent allocated"] --> G2["Build and test"]
        G2 --> G3["Agent released"]
        G3 --> G4["Input waits with no agent"]
        G4 --> G5["Agent allocated again"]
        G5 --> G6["Deploy steps"]
    end
Figure 4: Wait outside the agent so executors stay free for other builds.

How to wait without an agent

  • Declare no agent at the top of the pipeline and give each working stage its own agent. Place the approval in its own stage that has no agent.
  • Use the directive form, which pauses before the agent for that stage is allocated.
  • In scripted pipelines, place the input step outside the block that requests a machine.

What you give up

When the agent is released, the workspace on it may be cleaned or reused. If the deploy stage needs the files built earlier, save them first, either by stashing them, which is Jenkins’ way of temporarily storing files for later stages, or by archiving them. The next agent then retrieves them. This small extra work is the price of not wasting slots, and at scale it is well worth paying.

Illustration: the empty machines

A team has 10 executors and runs about 60 builds per day. Six of those builds wait an average of two hours for approval while holding an executor. That is twelve executor-hours lost each day, equal to more than a full machine slot wasted every single day. Moving the prompts outside the agent returns all of it.

10Timeouts: Never Wait Forever

A prompt with no time limit is a trap for the future.

By default an input prompt waits indefinitely. That sounds polite but causes real trouble. Forgotten builds pile up in the list of running jobs. Their old artifacts and records cannot be cleaned up. Weeks later someone clicks Proceed on a build whose code is long out of date, and stale software reaches production.

Wrap the prompt in a timeout

Jenkins has a general-purpose timeout step. You wrap the input inside it and choose an amount of time and a unit, such as minutes, hours or days. If nobody answers before the time expires, Jenkins cancels the wait and the run ends as aborted. In the declarative directive form, a timeout placed in the stage’s options also covers the prompt, because options are applied before the prompt appears.

SituationSuggested waitReason
Quick confirmation before a low-risk action15 to 60 minutesThe person is already watching the run
Approval before a normal releaseSeveral hoursCovers a lunch break or a meeting
Sign-off by another teamOne to three daysAllows for time zones and weekends
Anything beyond a weekReconsider the designCode changes too fast for a long wait

Timed out versus refused

Both a timeout and a person’s Abort end the run as aborted, so at first glance they look the same. They are very different in meaning: one means “nobody answered,” the other means “somebody said no.” Simple pipelines treat both alike. More advanced pipelines catch the interruption and check whether it came from the timer or from a person, then send a different message for each.

!
Watch out

A timeout must be long enough for real human behavior. If your approvers are in a different time zone, a 30-minute limit means approvals will constantly expire. Choose a value that matches how people actually work, not how you wish they would.

11Proceed, Abort and What Happens Next

Both answers change the future of the run.

When the approver proceeds

The answers, if any, are stored, a line in the log records who approved, and the pipeline moves on to the next steps. In the build history the run continues as a normal run, and its final result depends on the remaining stages.

When the approver aborts

The run ends immediately with the aborted result. Later stages are skipped. This is not an error; it is a valid, intentional answer. The gray color tells your team that a person decided to stop, not that the code is broken.

Reacting with the post section

The post section, the block that runs when a pipeline or stage finishes, has a condition named aborted. It runs when the run ended as aborted, which includes both a refusal and a timeout. This is the ideal place to send a message such as “The release was not approved” or to release resources that earlier stages reserved. Pipelines that start temporary test environments before the prompt should always tear them down in aborted or cleanup, or those environments will keep running and costing money.

flowchart TD
    P["Input prompt"] --> R{"Answer"}
    R -->|"Proceed"| OK["Deploy stage runs"]
    R -->|"Abort"| AB["Run ends as aborted"]
    R -->|"Time expires"| TO["Run ends as aborted"]
    OK --> PS["Post: success or failure blocks"]
    AB --> PA["Post: aborted block"]
    TO --> PA
    PA --> CL["Post: cleanup block"]
    PS --> CL
Figure 5: Every path through the prompt ends in the post section.

Example: the temporary test environment

A pipeline creates a temporary staging environment, runs tests there, and then asks a product owner to approve the release. The approver declines. Without an aborted block, the staging environment would stay alive all weekend. With one, it is torn down within a minute of the refusal.

12Who Can Approve: Submitters and Permissions

A button is only as safe as the list of people who can press it.

If you do not set a submitter list, any user who has permission to build the job can answer the prompt. That may be far too many people. The submitter option narrows it to named users or groups. Groups are especially useful because people join and leave teams, and you do not want to edit the Jenkinsfile each time.

Open

No submitter set

Anyone with build permission on the job may proceed. Fine for low-risk prompts inside a small team.

Group

Group-based

Only members of a named group, such as release-managers, may proceed. Easy to maintain as the team changes.

Named

User list

Only specific users may proceed. Use sparingly, because it breaks when someone is on holiday.

Mixed

Users and groups

A comma-separated list can mix both, allowing a group plus a named backup approver.

Separation of duties

In many companies a rule says that the person who wrote a change must not be the person who approves its release. The input step does not enforce this by itself. However, the submitterParameter option gives you the approver’s name as a variable. A pipeline can compare it with the name of the person who started or committed the build and stop the run if they are the same. This turns a policy document into automatic enforcement.

Where the identity comes from

Approver names come from whatever security system your Jenkins uses, such as Jenkins’ own user database or a company single sign-on service. The quality of your approval record therefore depends on the quality of your login setup. Shared accounts, where several people use the same login, make an approval record worthless because nobody can tell who really clicked.

i
Design tip

Always name at least two groups or people who can approve, so a single sick day does not freeze a release. Then record who did approve through the submitter parameter.

13Data Flow: From Prompt to Later Stages

Follow the answers and the approver’s name through the pipeline.

flowchart LR
    A["Approver fills form"] --> B["Answers: version, environment"]
    A --> C["Approver name"]
    B --> D["Deploy steps"]
    C --> E["Audit message in chat"]
    C --> F["Separation of duties check"]
    D --> G["Deployment record"]
    E --> G
    F -->|"same person"| H["Stop the run"]
Figure 6: Answers steer the deployment, and the approver’s name feeds the audit trail.
1

Ask

The prompt collects only what a machine cannot know: the target environment, a release note, or a final human yes.

2

Validate

The pipeline checks the answers before using them, for example that a version matches the expected pattern.

3

Use

Later steps read the values to decide what to deploy and where.

4

Record

The approver’s name and the answers are written to chat, to a deployment log, or to a change ticket.

The important principle is never trust a typed answer blindly. A person may mistype a version or pick the wrong option. Check the value against what the pipeline built. If the approver enters a version that does not match the build, stop and show a clear message instead of deploying something unexpected.

14Telling People a Decision Is Waiting

A prompt nobody knows about is just a delay.

Jenkins shows a paused notice on the build page, but approvers do not sit staring at build pages. A prompt that sits unseen for six hours is a common cause of slow releases. The fix is a notification sent just before the input step, telling the right people that a decision is waiting.

Chat

Channel message

A short message to the team channel: what needs approval, which version, and a direct link to the build. The quickest way to get attention.

Email

Email to approvers

Useful for formal approvers or those outside the chat tool. Include the same key facts and link.

Ticket

Change ticket update

Some organizations link the pipeline to a ticketing system so the approval request and its answer are stored in the official record.

Reminder

Second nudge

A reminder sent after some time, if no answer has come, keeps busy approvers from missing it.

What a good notification contains

  • The what: service name and version.
  • The where: the target environment.
  • The evidence: test results and a link to the report.
  • The link: a direct address to the build page or the prompt.
  • The deadline: when the prompt will time out.
!
Security note

Approving through a link means anyone who gets that link can try to open the page, although Jenkins still checks permissions. Never include secrets in the message, and remember that chat history is often searchable by many people.

Some teams also allow approval directly from chat with a button. That can be convenient, but it adds another system to secure, so treat it with the same care as the Jenkins page itself. Make sure the approval still passes through a verified identity.

15Many Builds Waiting at Once

What happens when new code keeps arriving while an approval is pending.

Real teams push code several times a day. Each push starts a build, and each build may reach the approval gate. Now imagine three builds all paused at the same prompt: version 4.10, 4.11 and 4.12. If the approver proceeds with 4.10 after 4.12 exists, an older version replaces or competes with newer work. This is a classic mistake in delivery pipelines.

Ways to keep order

Serial

Disable concurrent builds

Allow only one run of the job at a time. Simple, but new builds queue behind a waiting prompt.

Milestone

Milestones

A milestone step tells Jenkins that when a newer build passes a point, older builds that have not reached it should be cancelled. Old prompts vanish automatically.

Lock

Locking a resource

The lockable resources plugin lets only one deployment to production run at once, even across jobs.

Rule

Team agreement

Decide who approves what, and agree that only the newest waiting build should be approved.

Parallel branches

Jenkins can run several branches side by side in a stage. Putting an input prompt inside a parallel branch is possible but confusing, because the page then shows several waiting prompts and approvers may lose track. Prefer one prompt after the parallel work is done, asking for a single decision on the combined result.

Illustration: the wrong version

A team has three builds waiting for production approval. An approver returns from holiday, sees the oldest prompt first and approves it. The production system rolls back two weeks of work. With a milestone placed before the prompt, only the newest build would have been waiting, and the mistake could not happen.

16Useful Design Patterns

Proven ways of arranging human gates.

Pattern 1: Approval before production

Build, test and deploy to a staging environment automatically. Then pause for a named group to approve the production release. Machines do the heavy work; a person makes the risk decision.

Pattern 2: Choose the target

Use a choice parameter so the approver picks the environment or region for a deployment. The pipeline is the same; the person supplies the one piece that varies.

Pattern 3: Human quality sign-off

After automated tests pass, pause so a tester or designer can check something machines are poor at judging, such as how a new screen feels. The prompt records who signed off.

Pattern 4: Gradual rollout with confirmation

Release to a small share of users, pause for a person to review the health dashboards, then proceed to everyone. The prompt sits between the canary and the full rollout.

Pattern 5: Dangerous action confirmation

Before a destructive step, such as deleting old data or running a database change, ask for a confirmation with a clearly labeled button and a boolean tick box that the person must set on purpose.

Pattern 6: Approval with a time limit and a fallback

Wrap the prompt in a timeout, tear down resources when it expires, and send a message that the release was not approved in time. Nothing hangs and nothing is forgotten.

17Anti-patterns to Avoid

Habits that seem fine at first and cause pain later.

ANTI-PATTERN 01Avoid
What people do

They place the prompt inside an agent block and leave it waiting.

Why it hurts

An executor stays busy doing nothing. With several waiting builds, real work queues up behind idle machines.

Better approach

Wait outside any agent, using the directive form or a stage with no agent, and pass files with stash or archive.

ANTI-PATTERN 02Avoid
What people do

They leave the prompt with no timeout.

Why it hurts

Forgotten builds pile up, and someone eventually approves stale code weeks later.

Better approach

Always wrap the prompt in a timeout and handle the aborted result in the post section.

ANTI-PATTERN 03Avoid
What people do

They ask for approval for everything, even trivial changes.

Why it hurts

Approvers get tired and click Proceed without reading. The gate turns into a rubber stamp and gives false comfort.

Better approach

Automate every decision a rule can make. Keep human prompts for the few decisions that truly need judgment.

ANTI-PATTERN 04Avoid
What people do

They allow anyone to approve production releases, and use one shared login.

Why it hurts

The approval means nothing if nobody is accountable and the log cannot say who clicked.

Better approach

Restrict submitters to a named group, use individual logins, and record the approver through the submitter parameter.

ANTI-PATTERN 05Avoid
What people do

They type a vague message such as “Continue?” and trust free-text answers.

Why it hurts

Approvers cannot tell what they are approving, and typos reach deployment steps.

Better approach

Write specific messages with service, version and environment, and use choices and checks instead of open text.

18Best Practices and Common Mistakes

A checklist to apply to any Jenkinsfile today.

Do this

  • Wait outside any agent so executors stay free.
  • Wrap every prompt in a timeout that matches real behavior.
  • Write specific messages with service, version and environment.
  • Label the green button with the action, not just Proceed.
  • Restrict submitters to a group and name a backup.
  • Record the approver with the submitter parameter.
  • Notify approvers with a direct link when the prompt appears.
  • Tear down temporary resources in the aborted or cleanup blocks.

Avoid this

  • Holding an executor for the duration of a wait.
  • Prompts with no time limit.
  • Approving with vague messages or without checking evidence.
  • Shared logins for approvers.
  • Letting old builds wait for approval next to newer ones.
  • Prompting for decisions a rule could make.
  • Trusting typed answers without validating them.
  • Putting secrets in prompt messages or password fields.

Mistakes people make when they are new

Forgetting the files. After the wait, the deploy stage may run on a fresh agent with an empty workspace. If the built package was not saved with stash or archive, the stage fails looking for files that are gone.

Duplicating IDs. Two prompts in one run with the same id can confuse the approval links. Give each a unique, readable id.

Assuming Abort means broken. Aborted is not failed. Alerts that treat both alike will send false alarms whenever a person simply declines.

Ignoring restarts. A run waiting for input survives a controller restart, but the approver may not know that. After maintenance, check whether prompts are still pending and tell the approvers.

Skipping the practice run. Test the whole path on a test branch: proceed once, abort once, and let one time out. The first time these paths run should never be during a real release.

19Advantages, Disadvantages and Trade-offs

An honest look at what the input step does well and where it strains.

Advantages

  • Puts a human decision inside the same pipeline, with no split jobs.
  • Records who approved, which helps audits.
  • Collects typed answers that steer later steps.
  • Costs nothing while waiting when placed outside an agent.
  • Survives controller restarts.
  • Simple for newcomers to read and write.

Disadvantages

  • Slows delivery when approvers are slow or absent.
  • Easy to misuse and hold executors.
  • Limited built-in reminders and escalation.
  • No built-in separation of duties.
  • Basic form fields, with no rich validation.
  • Waiting builds can pile up without milestones or timeouts.

Trade-offs to weigh

ChoiceBenefitCost
Approval before every deploymentMaximum human controlSlower releases; approval fatigue
Approval only for productionFast staging, safe productionBugs found late in production-like checks
Short timeoutKeeps the queue cleanApprovals may expire in different time zones
Long timeoutFlexible for slow approversRisk of stale code and cluttered history
Wait outside the agentFrees executorsFiles must be stashed or archived
Wait inside the agentWorkspace stays intactWastes a slot for the whole wait

There is no universally right answer. The correct trade-off depends on how risky your changes are, how large your team is and how quickly approvers respond. What matters is that you choose deliberately and write down why.

20Security Around the Input Step

An approval gate is a security control, so it must be built like one.

The input step sits at the boundary between “code that passed tests” and “code that reaches customers.” That makes it a target. Anyone who can bypass or fake the approval can push unreviewed code to production. Good security around it is mostly common sense applied carefully.

Identity

Individual logins

Every approver signs in as themselves, ideally through the company single sign-on service. Without real identities the audit trail is empty.

Access

Least privilege

Only the smallest useful group may proceed. Everyone else can watch but not decide.

Code

Protect the Jenkinsfile

Whoever can edit the Jenkinsfile can remove the prompt or widen the submitter list. Require review for changes to it, as you would for any release script.

Secrets

Avoid password fields

Typing secrets into a prompt is risky. Store credentials in the Jenkins credentials store and bind them only to the steps that need them.

Trust

Pull requests from outsiders

If builds run for code from external contributors, a modified Jenkinsfile could skip the prompt. Configure Jenkins so such builds use the trusted version of the pipeline file and never reach production stages.

Audit

Keep the evidence

Keep build logs long enough to satisfy audit needs. The line showing who approved is only useful if it is still there when someone asks.

!
Security rule

An approval that can be given by the same person who wrote the change, or by any anonymous user, is not a control. It is decoration. Design the gate so that a real, accountable second person must say yes.

Validate what was typed

Any text an approver types can end up inside a command. If a pipeline pastes a typed value straight into a command line, a careless or hostile entry could run something unintended. Use choices instead of free text where possible, and check any text against a strict pattern before use.

21Monitoring, Logging and Metrics

How to know that your approval gates are healthy and not slowing you down.

What Jenkins logs for you

When a person proceeds, the console log records that the input was approved and by whom. When someone aborts, the log records the abort and who did it. This gives you a basic audit trail with no extra work. Add your own log lines for the parameters chosen, so a later reader sees not just that a release was approved but which version and environment.

Metrics worth watching

MetricWhy it mattersWarning sign
Time waiting for approvalThe largest hidden delay in many pipelinesMedian wait grows week after week
Share of prompts that time outShows unattended or badly timed promptsMore than a few percent expire
Share of prompts aborted by peopleShows how often the gate really catches somethingZero over many months suggests a rubber stamp
Executor hours held while waitingReveals prompts placed inside agentsAny non-zero number
Builds waiting at onceSignals missing milestonesMore than one waiting build per job
Approver spreadShows whether one person is a bottleneckA single approver handles nearly everything

Monitoring plugins that expose Jenkins numbers to systems such as Prometheus, plus dashboards on a wall screen, make waiting builds visible to everyone. Some teams add an alert when a prompt has been waiting longer than a chosen time, so that stuck approvals are noticed before the timeout ends them.

Illustration: the rubber stamp

A team reviews a year of data and finds that 998 of 1,000 approvals were given within thirty seconds and none were ever declined. The prompt is not protecting anything. They redesign the gate: the message now includes test results and the change summary, and approvers must tick a box confirming they reviewed them. Declines begin to appear, and the gate starts to earn its keep.

22Performance and Scalability

What waiting costs when hundreds of builds run each day.

A prompt placed correctly costs almost nothing in computing terms: the run is a saved position and a small web form. The cost is in time and attention, and in what the run holds while it waits.

Slots

Executors

Waiting inside an agent burns slots. Wait outside, and the cost disappears.

Disk

Workspaces and artifacts

Long waits keep workspaces, stashed files and artifacts alive. Set timeouts and discard old builds so storage does not grow without limit.

Memory

Many paused runs

Each paused run keeps a small record on the controller. Hundreds are usually fine, but thousands of forgotten ones are not. Timeouts and milestones keep the count low.

People

Approver capacity

At scale, the real bottleneck is people. Spread approval across a group, and reserve prompts for meaningful decisions.

Scaling practices

  • Gate only what matters. Ten prompts a day for one approver is a recipe for careless clicks.
  • Use milestones so only the newest build waits.
  • Use groups so approvals do not depend on one person.
  • Use notifications to shorten the time from prompt to answer.
  • Save files smartly. Stash only what the next stage needs, not the entire workspace.
40
illustrative approvals per day
45 min
illustrative average wait
30 h
waiting time added each day

Those numbers are only an illustration, but the message is real. Trimming the average wait by a third, through better notifications and a wider approver group, gives back ten hours of pipeline time every day for a team that size.

23Real-World and Industry Examples

How the ideas look in the kinds of organizations that run Jenkins at scale.

A bank’s release pipeline

Regulated banks must show that a change was reviewed by someone other than its author before reaching customers. Their pipelines run tests and security scans automatically, then pause with a named release-manager group as the only allowed submitters. The log line showing who approved becomes part of the evidence auditors ask for.

An online retailer before a big sale

Retail teams often freeze changes around peak shopping events. A pipeline can pause for approval only when a release falls inside a sensitive date range, and let ordinary releases pass automatically. The gate is used where the business risk is highest.

A streaming service and gradual rollouts

Large streaming and social platforms are well known for releasing new code to a small slice of users first. A pipeline can deploy to that slice, pause for an engineer to review error rates and viewing quality, and then continue to everyone if the numbers look healthy.

A hospital software vendor

Software used in healthcare often needs a quality officer to sign off before a version ships. The prompt records the officer’s name and a short note. That note, saved with the build, becomes part of the release documentation.

A small startup

A team of six deploys to staging automatically and asks one of two senior engineers to approve production. They set a four-hour timeout, send a chat message with a link, and use a milestone so only the latest build waits. Simple, safe and quick.

flowchart TD
    C["Code pushed"] --> B["Build and unit tests"]
    B --> SC["Security scan"]
    SC --> ST["Deploy to staging"]
    ST --> AT["Automated acceptance tests"]
    AT --> N["Notify approvers with link"]
    N --> G{"Input: approve production?"}
    G -->|"Proceed"| PR["Deploy to production"]
    G -->|"Abort or timeout"| TD["Tear down and notify team"]
    PR --> V["Post-deploy checks"]
    V --> DONE["Done and recorded"]
Figure 7: A typical production pipeline with one human gate between staging and production.

24Input Versus Other Ways to Involve a Person

Where the input step fits among its alternatives.

ApproachHow it worksStrengthWeakness
Input stepPauses a running pipeline for a decisionOne pipeline, clear record, typed answersRun stays open while waiting
Build with parametersA person starts a run and fills a form at the startSimple; nothing waitsOnly asks before the run, not in the middle
Separate deploy jobA second job is started manually or by a triggerClear separation and independent historyLink between jobs can break; two records to check
External approval systemA ticketing or change-management tool holds the decisionFits company processes and rich workflowsExtra integration and more systems to secure
Fully automatic with checksRules and health metrics decideFastest; no human waitNot allowed or trusted for every change

The parameterized build is the closest relative. It asks its questions before the pipeline starts, so nothing waits and no run sits paused. Its weakness is that the person must decide before seeing the results of the tests. The input step asks after the machine has produced evidence, so the human decides with better information.

!
Choosing

If the question needs test results to answer, use an input step. If the question can be answered before anything runs, such as which environment to target, a build parameter is simpler. If company policy demands a formal ticket, integrate with the external system and, if useful, keep an input step as the final human confirmation.

25A Complete Run, Told as a Story

Follow one imaginary pipeline from push to production.

A small team owns a booking service. Their pipeline has four stages: Build, Test, Staging and Production. There is no agent at the top. The first three stages each use their own agent. The Production stage has an input directive that lets only the release-managers group proceed, with a four-hour time limit and a green button labeled “Release to customers.”

1

The push

Maya pushes a change. A milestone cancels an older build that was still waiting for approval, so only her build remains in the queue.

2

Build and Test

The code compiles and 800 tests pass. The build package is stashed so a later stage can retrieve it.

3

Staging

The service is deployed to the staging environment and automated acceptance checks pass. The agent is then released.

4

Notification

A message goes to the release channel: “Booking service 4.12 is ready for production. 800 tests passed. Approve within 4 hours,” with a link to the build page.

5

The pause

The Production stage reaches its input directive. The run shows “Paused for Input.” No agent is held and no computing power is used.

6

The decision

Ravi, a release manager, opens the page, reads the summary and clicks “Release to customers.” The log records his name. A check confirms he is not Maya, satisfying separation of duties.

7

Deploy

A fresh agent is allocated, the stashed package is retrieved, and the production deployment runs.

8

Post section

The pipeline-level post block sends a success message with the approver’s name and version, and the cleanup block removes the workspace.

Had Ravi clicked Abort, or had four hours passed without an answer, the run would have ended as aborted. The post section’s aborted block would have torn down the staging environment and told the team the release was not approved. No manual cleanup, no forgotten machines, and a clean record either way.

A good approval gate is invisible when things are fine and unmistakable when they are not.

26Troubleshooting Guide

Symptoms, likely causes and calm fixes.

SymptomLikely causeWhat to do
Approver sees the prompt but cannot proceedUser is not in the submitter list or lacks build permissionAdd the user or group, or check permissions on the job
Executors stay busy while waitingPrompt is inside an agent blockMove it outside the agent or use the directive
Deploy stage cannot find files after approvalFresh agent with an empty workspaceStash or archive the package before the prompt
Approvals keep expiringTimeout too short for approversLengthen it and send reminders
Old builds approved by mistakeSeveral builds waiting togetherAdd milestones or disable concurrent builds
Nobody noticed the promptNo notificationSend a chat or email message with a link before the prompt
Alert fires when someone declinesAborted treated like failureHandle the aborted condition separately
Answers come back emptyNo parameters defined or the value is read from the wrong placeCheck the number of parameters and how the return value is stored
Temporary environments keep runningNo teardown on aborted or timed-out runsAdd aborted and cleanup blocks in the post section
Prompt disappeared after maintenanceRun was cancelled or the job configuration changedCheck the run status and start a new build if necessary

A calm debugging routine

  1. Open the build page and confirm the run really is paused for input.
  2. Check who is trying to proceed and whether they are on the submitter list.
  3. Look at the agent usage on the executor status page to see if a slot is held.
  4. Read the log around the prompt for the approver line and any errors after resuming.
  5. Reproduce on a test branch and change one thing at a time.

27Plain-English Glossary

Every important word in this guide in one place.

WordSimple meaning
JenkinsA free automation server that builds, tests and delivers software.
PipelineA written recipe of the steps Jenkins follows.
JenkinsfileThe text file holding the pipeline, stored next to the code.
StageA named phase, such as Build or Deploy.
StepOne single action inside a stage.
Input stepA step that pauses the run and waits for a person.
Input directiveThe declarative, stage-level form of the same idea.
ControllerThe main Jenkins server that holds the paused run.
AgentA worker machine or container that runs steps.
ExecutorA slot on an agent that can run one job.
SubmitterThe person who answers the prompt.
ParameterA typed question shown in the prompt.
TimeoutA time limit after which a waiting step is cancelled.
MilestoneA marker that cancels older runs when a newer one passes it.
StashA temporary store of files passed between stages or agents.
AbortedA gray result meaning the run was stopped on purpose or by time.
Post sectionA block that reacts after a stage or pipeline finishes.
WebhookAn automatic message telling Jenkins that something happened.

28Frequently Asked Questions

Short answers to the questions that come up most often.

Q1Does a waiting input prompt use up an executor?
Only if it is placed inside an agent block. Placed outside any agent, or written as a stage-level directive, it waits without holding an executor.
Q2How long will Jenkins wait for an answer?
Forever, unless you add a time limit. Wrap the prompt in a timeout step, or use a timeout in the stage options when using the directive.
Q3What happens if Jenkins restarts while a run is waiting?
The run is saved to disk and normally resumes waiting after the restart. It is still good practice to check pending prompts after maintenance.
Q4Who can click Proceed if I set no submitter?
Any signed-in user with permission to build the job. For anything risky, set a submitter group.
Q5What result does a refusal produce?
The run ends as aborted, shown in gray. A timeout also produces aborted, so tell them apart if the difference matters to you.
Q6How do I record who approved?
Use the submitter parameter option to receive the approver’s user name as a variable, then write it to a log line, chat message or deployment record. Jenkins also logs the approval itself.
Q7Can I ask several questions in one prompt?
Yes. Add several parameters. With the step form the answers return as a map, and with the directive form each becomes an environment variable.
Q8What is the difference between the step and the directive?
The step is used inside a stage’s steps and works in scripted and declarative pipelines. The directive belongs to declarative pipelines, sits at stage level and pauses before the agent is allocated.
Q9Why did my deploy stage fail after approval?
Often the deploy stage ran on a new agent with an empty workspace. Stash or archive the files you need before the prompt and retrieve them afterwards.
Q10Can the author of a change approve it?
By default yes, if allowed to build the job. Enforce separation of duties by comparing the approver name with the change author and stopping the run if they match.
Q11How do I stop old builds from waiting beside new ones?
Use milestones, or disable concurrent builds, so that only the newest build stays in the queue for approval.
Q12Should every deployment have an approval prompt?
No. Reserve prompts for decisions that need human judgment or must be recorded, usually production releases and dangerous actions. Too many prompts lead to careless clicking.

29Summary and Key Takeaways

The whole story in a few lines.

The input step gives a Jenkins pipeline a human gate. It pauses the run, asks a question, waits for an authorized person, and then either continues or stops. It can collect typed answers, record who approved, and survive restarts. Used well, it sits outside any agent, has a time limit, names who may answer, tells them a decision is waiting, and cleans up whichever way the answer goes. Used badly, it wastes machines, piles up forgotten builds and creates approvals that mean nothing.

Key Takeaways

  • Input is a human gate. Use it for decisions that need judgment or a recorded sign-off, and automate everything a rule can decide.
  • Wait outside the agent. Use the stage directive or a stage with no agent so no executor is held, and stash the files you need afterwards.
  • Always set a timeout. Forgotten prompts pile up and invite approval of stale code.
  • Restrict and record. Limit submitters to a named group, use individual logins and capture the approver with the submitter parameter.
  • Write messages that let people decide. Include service, version, environment and evidence, and label the green button with the real action.
  • Handle aborted on purpose. Refusals and timeouts both end as aborted, so tear down resources and notify the team in the post section.
  • Keep the queue tidy and test every path. Use milestones for ordering, and practice proceed, abort and timeout on a test branch before a real release.