Workflow api

raise exception if we switch to graph mode after executing some things already