Flexible framework for workflow and process automation