Dynamic Workflow Selection not working after update

Hey,

Before upgrading to UIPath 2022.10.1, I had a lot of processes in which I invoked different workflows depending on some conditions. I did this with a kind of dynamic call to these workflows, like this:

image (“bej” is a string variable)

And had similar workflows with different names. After updating, I’m getting this error

image

Is there something I now need to do differently in order for that to work as it did before?

EDIT: I know I can work around this by nesting a bunch of ifs, I was just wondering if the change was intentional.
Thanks,
Matias

Hi @matias.lynch

I’d there any specific reason to invoke workflow path dynamically?

Regards
Sudharsan

Hey Sudharsan,
I have to access different websites depending on what an initial condition is, so I did that rather than some nested ifs.

Hello @matias.lynch ,

You might try to use an assign (testVar = “Login” + bej + “.xaml”) prior your invoke workflow file activity, and afterwards
Within the invoke workflow activity just pass the testVar.

It sounds strange, but sometimes it is worthy to separate the computation from the actual activity that you are using.

P.S. And do not forget to have the latest version of the used packages both within your workflow, and within your invoked workflow…

Hope this helps!
Best regards,
Marius

Okay so can try this @matias.lynch

Instead of passing the flow name directly in the invoke workflow activity

Can you create a variable before and pass that variable in the invoke workflow activity?

Regards
Sudharsan

Hey Marius,
Yes, I also tried this but got the same result:
image
And yes, all packages are updated.
Thanks,
Matias

@matias.lynch
Can you check with message box whether it is returning correct path?

Regards
Sudharsan

It’s weird, I can’t even debug the process. It throws out that error when validating the process and never starts, so I can’t really print out the path.

Can you share the screenshot of the error?

Yes, its in the thread above.

Hello @matias.lynch ,

Check this:

Also, in the end please these points:

  1. Try to invoke a file that is not on OneDrive.
    Perhaps your windows security was also updated:
  • Antivirus policies that restrict PowerShell access may prevent the use of PowerShell-related activities. For example, you cannot use Invoke Workflow File and Invoke Power Shell when rule ID 6151 is enabled in McAfee Endpoint Security.
  1. If you have persistence activities within your invoked file
  • When invoking a workflow, make sure it does not contain persistence activities. These should only be used in the main workflow.

More info: https://docs.uipath.com/activities/docs/about-the-persistence-activities-pack

  1. If ‘bej’ contains a dot:

Every invoked .xaml file whose title contains a dot (. ) has all the text that is before the dot (including the dot) replaced with an underscore (_ ).

Source: https://docs.uipath.com/activities/docs/invoke-workflow-file

Hope this helps!
Best regards,
Marius

@matias.lynch ,
Is your workflow available under the same project folder? then give a relative path instead of giving the absolute path.

eg: if it is inside the project folder

just give “filename.xaml” only instead of C:\users\matia\Onedrive\project folder\filename.xaml

Also make in a message box print the whole whole string you are giving and copy and paste it in run command and try to open
eg:
image

Hey Marius,
Thanks for the tips. Here’s what I tried and how they turned out:

  1. Using an absolute path didn’t work, it didn’t even register it as a full path, it thought it was a relative path so it threw this error:
    image
    And yes, the file exists in the folder in the right path with the right name. I’ve been working with dynamic paths before so I know they used to work.
  2. I tried moving the file to a non-OneDrive folder and it still threw the same error.
    3)I don’t have any antivirus installed so I doubt that could’ve caused it. I only have Windows Defender, and the workflow I’m trying to invoke isn’t PowerShell related, nor does it have persistence activities in it.
  3. bej is just a dummy variable that I used to test this. It literally just contains “Bejerman” in it.

What’s interesting about this issue is that it’s not a runtime error. It throws out the exception after checking for validation errors, so I’m guessing something changed in the process with the latest Studio Update. Should I flag this as a potential bug?
Thanks,
Matias

Hey muhamed,

I’m giving it a relative path. The invoke workflow activity only contains "Login " + bej + “.xaml”. The error shows where Studio is trying to find the workflow before even analyzing the variable “bej”.

@matias.lynch ,
Can you show me the actual name of the file (any one xaml file?)

is the space after login is needed?? if not remove it and try to run

The file is there and called “Login Bejerman”. The problem is that UIPath tries to find the file before even starting the process, so it fails because the variable is null at the moment.

@matias.lynch

Can you give some default value for the variable and if needed you can make the string as empty using an assign activity after starting execution And try …?

Looking forward for your reply.!