When using the persistence package and executing a workflow in Studio 2024.10.1 getting this error: Could not find file 'C:\Users\<User>\AppData\Local\UiPath\InstanceStore\<GUID>'.

Why am I getting the error 'Could not find file 'C:\Users\AppData\Local\UiPath\InstanceStore' when executing a workflow using the Persistence package in UiPath Studio 2024.10.1?

Issue description:

Users may experience an issue in Studio v24.10.1 where an automation workflow fails during the second run due to an incorrect reference to a temporary file. This file, located at %appdata%\Local\UiPath\InstanceStore\{Randomalphanumericstring}, is generated during the first run of the automation. In Studio v24.10.1, this file is incorrectly reused in subsequent runs, leading to a "file not found" error as the file is deleted between runs.

Steps to Reproduce:

  1. Run an automation workflow in Studio v24.10.1.
  2. During the first run, a temporary file is created (e.g., 94d8204e-ee8b-4864-9df0-a14eb6c4cfed).
  3. On the second run, the automation fails because the referenced file cannot be found, even though it was created during the first run.

Testing and Findings:

  • Working Scenario (Studio 2023.10.x):
    • First run: A temporary file with ID 1bd4fd32-d12b-4f5e-a4d1-6caac10c2f07 is created.
    • Second run: A new temporary file with ID 8dd2e606-2f1f-4ae8-a1a7-c0fe8382a5d3 is created, and the automation completes successfully.

1st Run:

2nd Run:

  • Non-Working Scenario (Studio 24.10.1):
    • First run: A temporary file with ID 94d8204e-ee8b-4864-9df0-a14eb6c4cfed is created.
    • Second run: The same temporary file is referenced, but it cannot be found as it was deleted after the first run.

2nd Run:

Resolution:

We have tested with Studio versions 2024.10.5 and 2024.10.6, and the issue does not occur in these versions. It is recommended to upgrade to Studio >=2024.10.5 to resolve this issue.