Are there any links that could be helpful to work through the programs and caveats of such a SP?
Part of it for me is creating a table that can store the process in the database to be able to traverse it reasonably.