The REST API component can serve as a bridge between multiple flows by using Webhook and HTTP Reply components. This approach is particularly useful when you need to make a flow call more flexible, as the Webhook URL can be accessed from another flow or a third-party application. However, it’s important to note that this type of flow connection should not be used in other cases because it can create a heavier load than the Flow-Linking or PubSub components due to the creation of Webhooks and API requests.
To give you an example, you can imagine two flows. Side flow will perform the operation of splitting a string into an array of strings through a separator.
The main flow will send the original string to the other flow and receive the processed array of strings, then writing it to the database.
The side flow will be triggered by the Webhook, retrieving the source string.
With a simple JSONata expression, the string will be converted to an array of strings and returned back via HTTP Reply
As a result, we obtain an isolated Webhook URL that can be accessed by any application, including other flows. When we send a POST request with a body string that needs to be separated through a comma separator, this Webhook is triggered.
The main flow will send a request with a source string to the other flow and use the result of the other flow.
As a result, we get communication between the two components through HTTP requests.