Added error handling through a done channel and variable input arguments for pipeline execution