Interview Prep
Interview questions, roadmaps and practice sets
Tutorials
Free tutorials on 30+ topics
Blog
Career guides, skills and interview tips
Free PDFs
Notes, cheat sheets and question banks
Certificates
Free skill tests and course certificates
Tools & Whiteboard
Free tools you can use right in the browser
Practice Tests
Mock tests, MCQs and quick Q&A
Free LMS
Learn on the Uncodemy LMS
Choose the best training program according to your career.
Improve the performance of your business with our innovative Industrial Training Program.
Read More →
Our instructor-led training classes are designed to make you an expert.
Read More →
Real-life case studies are a great way to demonstrate your practical knowledge.
Read More →
Explore blogs, latest technologies and industry updates with practical examples.
Read More →Browse all available training programs and choose the right one for your career.
Read More →Know more about who we are and what we stand for.
Discover our mission to equip individuals with essential IT skills and industry expertise.
Read More →
Free tutorials, interview questions, tools and calculators to help you learn.
Explore →Learn, practice and plan your career — bilkul free.
Book a free video counselling session and pick the right course for you.
Read More →input pauses a running pipeline and waits for a person to click a button. It is how teams put a manual approval in front of a risky stage: build and test run automatically, then the pipeline waits until someone with the right permission says "Deploy" or clicks "Abort". Approve, and the pipeline continues; abort, and the build ends with the result ABORTED.
pipeline {
agent none // no agent held for the whole run
stages {
stage('Build and test') {
agent any
steps { sh './build.sh && ./test.sh' }
}
stage('Deploy to production') {
agent any
options { timeout(time: 4, unit: 'HOURS') }
input {
message 'Deploy this build to production?'
ok 'Deploy'
submitter 'release-managers' // user IDs or group names, comma-separated
submitterParameter 'APPROVER'
parameters {
choice(name: 'SLOT', choices: ['blue', 'green'], description: 'Target slot')
}
}
steps {
echo "Approved by ${APPROVER}, deploying to ${SLOT}"
sh './deploy.sh "$SLOT"'
}
}
}
}
Why this shape works well:
input directive is evaluated before the stage's agent is allocated, so no executor sits idle while you wait for a manager. That is the reason for agent none at the top and an agent per stage.timeout option wraps the wait. If nobody answers in four hours, the build is aborted instead of hanging for days.parameters and submitterParameter become environment variables for the rest of the stage (SLOT, APPROVER).blue or green from a drop-down.release-managers cannot approve; Jenkins rejects their click.Who counts as a submitter depends on your users and groups; see Jenkins user management.
When you need the answer as a Groovy value, call input as a step:
stage('Confirm') {
steps {
script {
def reason = input(
message: 'Release despite failing lint?',
ok: 'Release',
parameters: [string(name: 'REASON', defaultValue: '', description: 'Why?')]
)
echo "Released with reason: ${reason}"
}
}
}
With exactly one parameter, input returns that value. With several, it returns a map keyed by parameter name. With none, it returns nothing useful; it only pauses. If you use the step form inside a stage that has an agent, wrap it in timeout(time: 1, unit: 'HOURS') { ... } and remember the executor is held while waiting.
WorkflowScript compile error before the build starts: often the input { } block was put inside steps. As a directive it belongs directly in the stage; inside steps, use the step form input message: '...'.input. Use the stage-level directive with agent none at the top.submitter. Names are matched against Jenkins user IDs and group names, not display names.Related topics: pipeline parameters (values chosen at the start of a build) and post-build actions (for example, notify the team when a build is aborted).
Hands-on live training, real projects and Dedicated Placement Support — become job-ready in DevOps.
Enroll in DevOps Training →