Skip to content

Flow Control – Dependencies

TekMonks edited this page Dec 15, 2025 · 4 revisions

Dependency Format

The dependencies are how all the routing occurs for messages streaming inside the ASB. This also allows the ASB to a follow graph model or a linear waterfall or any combination between those, based on the routing conditions.

The latest dependency format is Jexl complaint (Javascript Expression Language). For example in the example below any message which was generated by the Email listener but not injected via the in-process listener will be accepted by the route node route.convertemail. As this is a simpler format, known easily to most developers, this is the preferred dependency encoding format going forward. It is terse, more robust and more flexible as well.

        route.convertemail:
          type: js
          dependencies: listener.email && (!listener.inproc)
          ...

The other, and older, method is using a dependency vector in the format

[["dependencyA","AndDependencyB"],["OrDependencyC","!NotDependencyD"],["dependencyA.error"]]

The dependency vector shown above indicates that a node will accept a message which is flowing out of a route node named dependencyA and also must have been processed by the node AndDependencyB successfully.

Alternatively, it will also accept a message flowing out successfully from node OrDependencyC as long as the same message was not processed at all by the node named NotDependencyD.

Finally, it will also accept messages which failed processing (i.e. had an error) for the route named dependencyA.

ASB is asynchronous, and message-driven - not synchronous flow-driven, so messages get routed to nodes that can process them, as soon as the message satisfies the dependency vector for that particular ASB node. Dependency vectors allow us to build complicated micro-streams or graph based flows, and in the simpler case, simple waterfall model-based flows.

Clone this wiki locally