         break
     @autoOrdering = null if bracketsClosed and @autoOrdering is true
 
+  done: ->
+    if @ordered or @autoOrdering
+      @processOutputQueue()
+    @load--
+    @emit 'deactivate', @load
+
 exports.Component = Component
 
 class ProcessInput

  # Finishes process activation gracefully
  done: (error) ->
    @error error if error
    if @nodeInstance.ordered or @nodeInstance.autoOrdering
      @result.__resolved = true
      @nodeInstance.processOutputQueue()
    @nodeInstance.load--

    input = new ProcessInput @inPorts, ip, @, port, result
    output = new ProcessOutput @outPorts, ip, @, result
    @load++
    @emit 'activate', @load
    @handle input, output, -> output.done()

  processOutputQueue: ->
