Pipeline cookbook from https://gist.github.com/stephenlauck/7a6103934013f7a110ac