Core API for a workflow engine