Uncodemy Logo ← Back to Course
Jenkins · Topic 14 of 15

Input Function in Pipeline

What Does the Input Function Do?

The input function pauses a pipeline and takes an explicit input/approval from the user before continuing.

Real-Time Scenario

Continuous Integration (build + test) happens automatically without asking anyone. But when it comes to the deploy stage, we often want a human checkpoint — typically an approval manager reviews everything and clicks OK to approve the deployment.

To make this work properly, managers are usually given full build permissions via Role-Based Strategy (see the User Management topic).

Example

pipeline {
    agent any
    stages {
        stage('Input function') {
            steps {
                sh 'echo "hi my name is sandeep"'
                input {
                    message "are you sure ?"
                    ok "yes"
                }
            }
        }
    }
}

What Happens on Build

This is exactly how manual approval gates are implemented before a production deployment in real projects.

Master Jenkins & DevOps with Uncodemy

Hands-on live training, real projects, and placement support — become job-ready in DevOps.

Enroll in DevOps Training →