 
     @runtime = null
     @ready = false
+    @graph = null
 
     @inPorts = new noflo.InPorts
     @outPorts = new noflo.OutPorts

    @runtime.connect()

  setupPorts: (ports) ->
    @setReady false
    if ports.inPorts.length is 0 and ports.outPorts.length is 0
      return
    # Expose remote graph's exported ports as node ports
    @prepareInport port for port in ports.inPorts
    @prepareOutport port for port in ports.outPorts
    setTimeout =>
      @setReady true
    , 100

  prepareInport: (definition) ->
    name = definition.id

        throw new Error "runtime #{@definition.id} does not declare protocol:runtime"
      if definition.graph
        noflo.graph.loadFile definition.graph, (graph) =>
          @graph = graph
          @runtime.setMain graph
          connection.sendGraph graph, @runtime, =>
            # ignore

    # TODO: make runtime base handle ports discovery similar to capabilities?
    portsRecv = 0
