         else
           console.log "No workflow #{selectedWorkflowID} for project #{@state.project.id}"
           @clearInactiveWorkflow(selectedWorkflowID)
-            .then(@getSelectedWorkflow())
+            .then(@getSelectedWorkflow(@state.project, @state.preferences))
 
   clearInactiveWorkflow: (selectedWorkflowID) ->
     preferences = @state.preferences

      linkedWorkflows[randomIndex]

  getWorkflow: (selectedWorkflowID) ->
    apiClient.type('workflows').get({ active: true, id: "#{selectedWorkflowID}" })
      .catch (error) =>
        console.error error
        # TODO: Handle 404 once json-api-client error handling is fixed.


  componentWillUpdate: (nextProps, nextState) ->
    if nextProps.location.query?.workflow? and @canFetchWorkflowByQuery(nextProps.project, nextProps.user)
      @getSelectedWorkflow(nextState.project, nextState.preferences) unless nextState.loadingSelectedWorkflow

    if nextState.preferences?.preferences?.selected_workflow? and @state.workflow?
      if nextState.preferences?.preferences.selected_workflow isnt @state.workflow.id
        @getSelectedWorkflow(nextState.project, nextState.preferences) unless nextState.loadingSelectedWorkflow

  componentWillUnmount: ->
    Split.clear()
