I sort of like the idea of sequences, but I would like to be able to have an action basically stop the sequence. The idea is to have an action which filters the incoming message, and if it doesn't meet certain criteria it would return false
or something and essentially stop the processing of the sequence.
I could probably incorporate a convention myself, but wondered if there was a mechanism.
You can fail the filtering action by returning a reject
ed Promise instead of a resolve
d one. That will fail the action and thus break the sequence at that point.
Here's a short example that might help:
function main(args) {
if(args.myValue == "myValue") {
return Promise.resolve({...});
} else
return Promise.reject({...});
}
}