Found the solution. To dynamically call a function we can use the below:
void execute(){
stepsApi = load("scripts/steps.groovy")
Map steps = [upload:[number: "1", type: "module"]]
steps.each { step, params ->
stepsApi."$step"(params)
}
}