diff --git a/models/workflow_execution/workflow_scheduler.go b/models/workflow_execution/workflow_scheduler.go index bd22437..7889a44 100644 --- a/models/workflow_execution/workflow_scheduler.go +++ b/models/workflow_execution/workflow_scheduler.go @@ -111,13 +111,11 @@ func (ws *WorkflowSchedule) Schedules(wfID string, request *tools.APIRequest) (* return ws, nil, []*WorkflowExecution{}, errors.New("no path found") } ok, wf, executions, err := ws.CheckBooking(wfID, request) - if !ok || err != nil { - return ws, nil, []*WorkflowExecution{}, errors.New("could not book the workflow : " + fmt.Sprintf("%v", err)) - } - - ws.Workflow = wf ws.WorkflowExecution = executions - + if !ok || err != nil { + return ws, nil, executions, errors.New("could not book the workflow : " + fmt.Sprintf("%v", err)) + } + ws.Workflow = wf for _, exec := range executions { err := exec.PurgeDraft(request) if err != nil {