WF can't find sub WF after move of files

Hello all!

After restructuring some files, my Wordflow can’t find a subworkflow.

I currently have a workflow that is located at <projectpath>\subfolder\WF.xaml
For test I have disabled everything in it, and only runs:
Write line: directory.getCurrentDirectory

The output for this is:
Where i would have expected to get

I assume the reason is that i created the Workflow, as an “extract as workflow” from inside another workflow in <projectpath> and then moved it manually to the subfolder.

Is this really working as intended and if so, why am I wrong?

Ok, so i did some more testing.

My tests shows that directory.getCurrentDirrectory somehow return the directory of where the project.json is located and NOT where the file is located.

My guess is that when i open a WF file. UiPath acually looks for the project.json file, and opens the WF in the project path instead of the actual path of the WF file.

This is really problematic for me as i offend rearrange file structure to keep sane :slight_smile:

When calling another workflow inside a project, it automatically use a relative path, and then if i change the folder structure, it creates problems.

Imagine a file structure:
file1: c:\folder\Main.xaml
file2: c:\folder\WF1.xaml
file3: c:\folder\WF2.xaml

file100: c:\folder\WF99.xaml

All files are a chain (so main calls WF1 that calls WF2 that calls WF3 that calls … that calls WF99)

Now i want to clean up, and move all WF files except Main to a subfolder.
Ofcause I have to change the first call from Main to WF1. That makes sense.
BUT i ALSO have to change ALL calls between the WF’s, witch is gonna take FOREVER to do…

What is the reason for this behaviour in UiPath?
Is there a way to get WINDOWS path to the current WF file, instead of UiPath’s relative project path?