Isolated in execution: concept and application in variables
Last updated
Last updated
The concept of "isolated in execution" refers to the practice of ensuring that variables used in an integration flow are not shared or altered by other simultaneous executions. By enabling the "isolated in execution" option in a variable’s configuration, it becomes easier to predict and understand the flow’s behavior, avoiding conflicts and unwanted outcomes.
Imagine a scenario with two distinct flows: one that simulates the arrival of items in a network and another that manages the updating of these items. In this example, a module responsible for saving an item needs to return a boolean value (true or false). This value influences the update of a variable called index, which is used to track the progress of the operation.
Suppose two instances of the flow are running simultaneously. Both share the same index variable.
When one execution alters the index, the other execution can also see this change. This can lead to issues such as unexpected changes and conflicts, resulting in inconsistent executions. For example, one execution might update the index 62 times while another updates it 57 times, leading to unpredictable behavior due to variable sharing.
If the "isolated in execution" option is activated, each flow will have its own instance of the index variable, independent of others. In other words, one execution can modify the variable’s value without affecting another.
With "isolated in execution" enabled, the index variable’s value will be maintained separately for each execution. Thus, each execution operates within its own context, avoiding conflicts. For instance, if an execution starts with index set to zero, it will continue to manage that value in isolation, regardless of what happens in other executions.
In addiction, the initial value of the variable will always be as defined in the creation or editing modal. For example, if it was set to 0, every execution will start with this initial value.