The wftk (open-source workflow toolkit) is a workflow engine in library form which can be integrated with whatever you need to integrate with.