danielduarte / flowed

A fast and reliable flow engine for orchestration and more uses in Node.js, Deno and the browser
https://danielduarte.github.io/flowed
MIT License
151 stars 21 forks source link

Notify when flow does not satisfies the expected result. #2

Open freakpol opened 5 years ago

freakpol commented 5 years ago

Right now, when executing the flow, we specify the desired results in the third parameter, for example

const response = await FlowManager.run(
      flowDefinition,
      parameters,
      ['myResponse'],
      resolvers,
);

But, when for whatever reason (for example a cyclic flow or and unintended incorrect flow), the flow ends and it does not have a myResponse property.

It would be ideal if you can notify of such cases so the rest of the code can react accordingly.

daniel-duarte commented 5 years ago

Thanks for the suggestion. Need to think and design a generic and flexible solution for this request. There are several cases to consider.