WIP: Workflow API

Still have broken tests.