ensureNode(node, direction) {
    const instance = this.getNode(node);
    if (!instance) {
      return Promise.reject(new Error(`No process defined for ${direction} node ${node}`));
    }
    if (!instance.component) {
      return Promise.reject(new Error(`No component defined for ${direction} node ${node}`));
    }
    const comp = /** @type {import("./Component").Component} */ (instance.component);
    if (!comp.isReady()) {
      return new Promise((resolve) => {
        comp.once('ready', () => {
          resolve(instance);
        });
      });
    }
    return Promise.resolve(instance);
  }
@protected
@param {string} node
@param {string} direction
@returns Promise<NetworkProcess>