[BUG] Library activity execution in parallel changes CWD affecting relative pathing activities

Description:
When executing library activies in parallel to other activities that use relative file pathing (e.g. Invoke Workflow), the current working directory (CWD) changes for the duration of the library activity’s execution. If a parallel activity uses relative pathing this results in that activity throwing an exception because during the library activity’s execution the current working directory is no longer the project path, but rather the library path. On completion of the library activity, the CWD is changed back to the project path, so the change in CWD is momentary.

Replication Details:

  • Version: UiPath Studio 2019.10.5
  • Affected Activities: Any using relative file path references when executed in parallel to a library activity.
  • Replication steps: Create a workflow with 3 parallel streams. In the first, execute a library activity on loop without any delay, in the second execute an invoke workflow activity (which expects a path relative to the project path) and have it loop without delay, and in the third a log message that outputs the current working directory on loop without delay. On execution, you’ll notice that the CWD changes for the duration of the library activity’s execution, then changes back to the project path when the library activity execution has completed.
  • Workarounds: Place any activities using relative pathing within a Retry Scope activity and set no condition so that it only retries on error. Given the change to the CWD is momentary, if you set a 1-second delay and an adequate amount of retries then subsequent executions of the contained activity will execute without error.
  • Screenshot:
    CWD
1 Like