New activity: Variable in sequence and flow charts

Hi all,
it would be nice to give sequences and flowcharts variables. Then one could determine in a retry scope or loop which of those sequences and flowcharts are passed. This could enhance flexibility and modeling capacity. Further, it gives further possibilities in exception handling.


I may have misunderstood your suggestion, but isn’t this feature already available?
You can define the scope of any variable to a particular sequence. That way, the variable can be accessed by any activities within that sequence.
If your Retry Scope or loop activity is within the scope of the sequence, it can access the variable(s) in question.

@RPAForEveryone thanks for asking, find below a more detailed description.

The aim would be to set variables for sequence and flowchart activities. Then include this new feature in retry scope and other workflow activities.

By that one could determine easy to only regard Sequence 1 and Flowchart in case of x and in case of y sequence 1, sequence 2 and flowchart are proceeded. This is just a small use case but I think there will be a variety of points that would make coding even easier.

Hi @PeCour

I am still a bit confused about the use case here :sweat_smile:

Would you like to pass entire sequence as an input for Retry Scope activity so that it repeats that particular scope, without it being inside of the scope?

It kind of sounds like something you would achieve in the Flowchart itself.

Some additional screenshots of the final desired flow and outcomes would be greatly appreciated :slight_smile:


Hi @loginerror

the actual benefit I am thinking of has not much to do with the retry scope itself. Therefore, the retry scope case might be a bit distracting.

The idea is really the screenshot above. So there is a possibility to give a sequence/flowchart with several activities a variable. Hence, one can use these such as subprocesses which are only targeted when wanted. One could do it today with variables and decisions but it wouldn’t be so useful.

Sequence 1 - Variable: 1 - Download user data
Sequence 2 - Variable: 2 - notify user
Flowchart 1 - Variable: 3 - Add Data into the system
Flowchart 2 - Variable: 4 - Send e-mail to customer

Now, this could all be in front of a switch:
For x follow the process steps: 1,2,3,4
For y follow the process steps: 1,3

Or we could put it into a retry scope with check app state and since the mails were sent only follow the process steps 1,3.
→ So in retry scope, we also would need e.g., an array variable where one could input {1,3}

(the example might not be perfect since these are only 4 sequences/flowcharts, but in big end-to-end processes there are many more sequences/flowcharts used)

A variable is a container for a piece of data (or object). To contain and reuse specific segments of code you create functions/methods.

The way to do this in UiPath is by simply exporting your sequence or flowchart as a standalone .xaml file, or if you want to go cross-project, a library activity.

Then by invoking you reuse that single sequence… the same effect as you describe as being a variable…


@Jeroen_van_Loon yes thanks, I know about these possibilities. And I know that would be a different way of doing things, but in my opinion, it can be complementary.

I really mean this on sequence level and not invoked processes. To structure your automation you use sequences in far more detail than invoked processes. In the code behind the activities, you could build a frame around a “sequence object” and give it a variable.

Well, thanks for the controversial discussion. If no one sees the benefit in this, it might just be not necessary :sweat_smile:

There are no bad ideas!
However, in this case, the suggested feature seems to be either just an additional way to implement what’s already possible in Studio or a more complicated way to manage/reuse workflows (depending on how well I’ve understood this suggestion)

The Flow Switch activity can already do this very easily, where you can utilise the TypeArgument property to choose the type of variable with which to switch flows.
The variable you’re suggesting to assign per sequence can simply be one variable that directs the flow down a certain sequence/flowchart.

@RPAForEveryone yes thanks for having a look at the idea anyway. Yes, you are right, it can already be done by other means in studio.

Perhaps, here a more detailed explanation:

New activity: