addNode(node, options, callback) {
    if (typeof options === 'function') {
      callback = /** @type {AddNodeCallback} */ (options);
      options = {};
    }
    let promise;
    // Processes are treated as singletons by their identifier. If
    // we already have a process with the given ID, return that.
    if (this.processes[node.id]) {
      promise = Promise.resolve(this.processes[node.id]);
    } else {
      /** @type {NetworkProcess} */
      const process = { id: node.id };
      // No component defined, just register the process but don't start.
      if (!node.component) {
        this.processes[process.id] = process;
        promise = Promise.resolve(process);
      } else {
        // Load the component for the process.
        promise = this.load(node.component, node.metadata)
          .then((instance) => {
            instance.nodeId = node.id;
            process.component = instance;
            process.componentName = node.component;
            // Inform the ports of the node name
            const inPorts = process.component.inPorts.ports;
            const outPorts = process.component.outPorts.ports;
            Object.keys(inPorts).forEach((name) => {
              const port = inPorts[name];
              port.node = node.id;
              port.nodeInstance = instance;
              port.name = name;
            });
            Object.keys(outPorts).forEach((name) => {
              const port = outPorts[name];
              port.node = node.id;
              port.nodeInstance = instance;
              port.name = name;
            });

            if (instance.isSubgraph()) {
              this.subscribeSubgraph(process);
            }
            this.subscribeNode(process);

            // Store and return the process instance
            this.processes[process.id] = process;
            return process;
          });
      }
    }
    if (callback) {
      deprecated('Providing a callback to Network.addNode is deprecated, use Promises');
      promise.then((process) => {
        callback(null, process);
      }, callback);
    }
    return promise;
  }
@param {import("fbp-graph/lib/Types").GraphNode} node
@param {Object} options
@param {AddNodeCallback} [callback]
@returns {Promise<NetworkProcess>}