How to use recursive



Any one who knows how to use recursive method?

Uipath recursive

make a xaml for that method and pass the arguments for that method.
you can then call that xaml recursively similar to the method that you wanted to call.


could you kindly give me an example ?


Run the recursion.xaml (3.6 KB)



Although you can do recursion in UiPath Studio I don’t really recommend it. I don’t think I encountered a situation in which you need to use recursion in UiPath Studio and it can cause problems with Memory.


Hello Cosmin, how can we do recursive in uipath studio?

For example I want to enter in a function “ABC” and obtain a result (array of string) with all the permutation:

in string : “ABC”
out string [] : “ABC, ACB, BAC, BCA, CAB, CBA”

of course i want the in string to be dynamic so it will bring me all the permutations of that letters in the given word.

Thanks and regards,


Refer this link

Try this way

static char[] numbers = {'0','1','2','3','4','5','6','7','8','9'}
static bool continuar = true
private static void Start(int maxLength)
        for (int i = 0; i <= maxLength; i++)
            Permutations(i, 0, "");

private static void Permutations(int keyLength, int position, string baseString)
    bool print = true;
    if (continuar)
        for (int i = 0; i < numbers .Length; i++)
            string temp = baseString + numbers [i];
            if (position <= keyLength - 1)
                Permutations(keyLength, position + 1, temp);
                print = false;
            if (continuar && print)



Thanks Arivu, but i need a solution uipath, not in Visual Studio nor in C#.

I thought about invoke code activity, but i can not call a function inside it (call a function inside a function).

Regards, Bogdan.


Hello. You can use Invoke Workflow and inside use again Invoke workflow.


Thanks Cosmin.
Have a nice day!


WHat if you want to create a workflow to read Json Properties but a property value can in turn be a json object or json array ? In that case you’ll need a recurse workflow.


Dear all,

I would like to calculate the Recursion Depth level (level 0, level 1 etc.). Do you know how to do it?



I want to read all filenames in a particular folder and if the folder contains another folder, it should read that folder’s files too.
So in this case, I think, we will need recursion concept.