async start(diff) {
        var self = this;
        // Create a subflow node to accept inbound messages and route appropriately
        var Node = require("../nodes/Node");

        if (this.subflowDef.status) {
            var subflowStatusConfig = {
                id: this.subflowInstance.id+":status",
                type: "subflow-status",
                z: this.subflowInstance.id,
                _flow: this.parent
            }
            this.statusNode = new Node(subflowStatusConfig);
            this.statusNode.on("input", function(msg) {
                if (msg.payload !== undefined) {
                    if (typeof msg.payload === "string") {
                        // if msg.payload is a String, use it as status text
                        self.node.status({text:msg.payload})
                        return;
                    } else if (Object.prototype.toString.call(msg.payload) === "[object Object]") {
                        if (msg.payload.hasOwnProperty('text') || msg.payload.hasOwnProperty('fill') || msg.payload.hasOwnProperty('shape') || Object.keys(msg.payload).length === 0) {
                            // msg.payload is an object that looks like a status object
                            self.node.status(msg.payload);
                            return;
                        }
                    }
                    // Anything else - inspect it and use as status text
                    var text = util.inspect(msg.payload);
                    if (text.length > 32) { text = text.substr(0,32) + "..."; }
                    self.node.status({text:text});
                } else if (msg.status !== undefined) {
                    // if msg.status exists
                    if (msg.status.hasOwnProperty("text") && msg.status.text.indexOf("common.") === 0) {
                        msg.status.text = "node-red:"+msg.status.text;
                    }
                    self.node.status(msg.status)
                }
            })
        }


        var subflowInstanceConfig = {
            id: this.subflowInstance.id,
            type: this.subflowInstance.type,
            g: this.subflowInstance.g,
            z: this.subflowInstance.z,
            name: this.subflowInstance.name,
            wires: [],
            _flow: this
        }
        if (this.subflowDef.in) {
            subflowInstanceConfig.wires = this.subflowDef.in.map(function(n) { return n.wires.map(function(w) { return self.node_map[w.id].id;})})
            subflowInstanceConfig._originalWires = jsonClone(subflowInstanceConfig.wires);
        }

        this.node = new Node(subflowInstanceConfig);
        this.node.on("input", function(msg) { this.send(msg);});
        // Called when the subflow instance node is being stopped
        this.node.on("close", function(done) {
            this.status({});
            // Stop the complete subflow
            self.stop().finally(done)
        })
        this.node.status = status => this.parent.handleStatus(this.node,status);
        // Create a context instance
        // console.log("Node.context",this.type,"id:",this._alias||this.id,"z:",this.z)
        this._context = context.get(this._alias||this.id,this.z);


        this.node._updateWires = this.node.updateWires;

        this.node.updateWires = function(newWires) {
            // Wire the subflow outputs
            if (self.subflowDef.out) {
                var node,wires,i,j;
                // Restore the original wiring to the internal nodes
                subflowInstanceConfig.wires = jsonClone(subflowInstanceConfig._originalWires);
                for (i=0;i<self.subflowDef.out.length;i++) {
                    wires = self.subflowDef.out[i].wires;
                    for (j=0;j<wires.length;j++) {
                        if (wires[j].id != self.subflowDef.id) {
                            node = self.node_map[wires[j].id];
                            if (node && node._originalWires) {
                                node.wires = jsonClone(node._originalWires);
                            }
                        }
                    }
                }

                var modifiedNodes = {};
                var subflowInstanceModified = false;
                for (i=0;i<self.subflowDef.out.length;i++) {
                    wires = self.subflowDef.out[i].wires;
                    for (j=0;j<wires.length;j++) {
                        if (wires[j].id === self.subflowDef.id) {
                            subflowInstanceConfig.wires[wires[j].port] = subflowInstanceConfig.wires[wires[j].port].concat(newWires[i]);
                            subflowInstanceModified = true;
                        } else {
                            node = self.node_map[wires[j].id];
                            if (node) {
                                node.wires[wires[j].port] = node.wires[wires[j].port].concat(newWires[i]);
                                modifiedNodes[node.id] = node;
                            }
                        }
                    }
                }
                Object.keys(modifiedNodes).forEach(function(id) {
                    var node = modifiedNodes[id];
                    self.activeNodes[id].updateWires(node.wires);
                });

                if (subflowInstanceModified) {
                    self.node._updateWires(subflowInstanceConfig.wires);
                }
            }
        };

        // Wire the subflow outputs
        if (this.subflowDef.out) {
            for (var i=0;i<this.subflowDef.out.length;i++) {
                // i: the output index
                // This is what this Output is wired to
                var wires = this.subflowDef.out[i].wires;
                for (var j=0;j<wires.length;j++) {
                    if (wires[j].id === this.subflowDef.id) {
                        // A subflow input wired straight to a subflow output
                        subflowInstanceConfig.wires[wires[j].port] = subflowInstanceConfig.wires[wires[j].port].concat(this.subflowInstance.wires[i])
                        this.node._updateWires(subflowInstanceConfig.wires);
                    } else {
                        var node = self.node_map[wires[j].id];
                        if (node) {
                            if (!node._originalWires) {
                                node._originalWires = jsonClone(node.wires);
                            }
                            node.wires[wires[j].port] = (node.wires[wires[j].port]||[]).concat(this.subflowInstance.wires[i]);
                        } else {
                            this.error("Unknown node referenced inside subflow: " + wires[j].id)
                        }
                    }
                }
            }
        }

        if (this.subflowDef.status) {
            var subflowStatusId = this.statusNode.id;
            wires = this.subflowDef.status.wires;
            for (var j=0;j<wires.length;j++) {
                if (wires[j].id === this.subflowDef.id) {
                    // A subflow input wired straight to a subflow output
                    subflowInstanceConfig.wires[wires[j].port].push(subflowStatusId);
                    this.node._updateWires(subflowInstanceConfig.wires);
                } else {
                    var node = self.node_map[wires[j].id];
                    if (node) {
                        if (!node._originalWires) {
                            node._originalWires = jsonClone(node.wires);
                        }
                        node.wires[wires[j].port] = (node.wires[wires[j].port]||[]);
                        node.wires[wires[j].port].push(subflowStatusId);
                    } else {
                        this.error("Unknown node referenced inside subflow: " + wires[j].id)
                    }
                }
            }
        }
        return super.start(diff);
    }
Start the subflow.
This creates a subflow instance node to handle the inbound messages. It also
rewires an subflow internal node that is connected to an output so it is connected
to the parent flow nodes the subflow instance is wired to.
@param  {[type]} diff [description]
@return {[type]}      [description]