Reusable Flows - SubFlows

Many a times we need a common business logic to be implemented in multiple APIs and places, and we do not want to build this common logic from scratch every single time.

That's where SubFlows come into the picture, allowing you to define your custom common logic just once and then reuse it in multiple APIs or other SubFlows (just like a reusable function).

Building SubFlows

You can build SubFlows in Cosmocloud, which accepts multiple arguments and can return a single JSON object - you can use different keys in the JSON object to return multiple objects at once.

Checkout how to create SubFlows here.

Using Execute SubFlow Node

You can then use the Execute SubFlow node in Cosmocloud's Flow Builder, to call any created SubFlow in the system. You can also pass your arguments to this SubFlow call, as mentioned in the SubFlow documentation.

Checkout how to use Execute SubFlow node.

Last updated