     @props.workflow.addLink 'subject_sets', [DEMO_SUBJECT_SET_ID]
 
   handleDelete: ->
-    @props.workflow.delete().then =>
-      @props.project.uncacheLink 'workflows'
-      @history.pushState(null, "/lab/#{@props.project.id}")
+    @setState deletionError: null
+
+    confirmed = confirm 'Really delete this workflow and all its tasks?'
+
+    if confirmed
+      @setState deletionInProgress: true
+
+      @props.workflow.delete().then =>
+        @props.project.uncacheLink 'workflows'
+        @history.pushState(null, "/lab/#{@props.project.id}")
+      .catch (error) =>
+        @setState deletionError: error
+      .then =>
+        if @isMounted()
+          @setState deletionInProgress: false
 
   handleTaskChange: (taskKey, path, value) ->
     changes = {}


          <div>
            <small>
              <button type="button" className="minor-button" disabled={@state.deleteInProgress} data-busy={@state.deleteInProgress || null} onClick={@handleDelete}>
                Delete this workflow
              </button>
            </small>{' '}
            {if @state.deleteError?
              <span className="form-help error">{@state.deleteError.message}</span>}
          </div>
        </div>


    selectedTaskKey: @props.workflow.first_task
    goldStandardFilesToImport: null
    forceReloader: 0
    deletionInProgress: false
    deletionError: null

  workflowLink: ->
    [owner, name] = @props.project.slug.split('/')
