must
must

Reputation: 226

How to get the outputs from a CONNECT platform internal programatic call?

When using internal node call on CONNECT platform as described in the following answer: How to make a node call from another node in a package on CONNECT platform, how would one go about getting the outputs of that call?

Upvotes: 1

Views: 27

Answers (1)

platform.call returns a Promise object, so you would basically need to do something like this:

platform.call('/whatever', { param: 'stuff' })
  .then(response => {
    //
    // handle the response.
    // - `response.output` will denote which output of the node's signature was
    //    activated,
    // - `response.data` will be the data sent to that output,
    // - `response.control` will be the control output of the node according to its
    //    signature.
    //
  })
  .catch(error => {
  //
  // whatever error handling logic.
  //
  });

for a refresher on node signatures, outputs, control outputs, etc., perhaps take a look here: https://medium.com/connect-platform/connect-platform-basic-concepts-543b79c3094e

Upvotes: 1

Related Questions