Run a python script in a .exe from cx_Freeze

Hello to all tech enthusiasts!
I hope you’re all well.

I have the following scenario:
I developed some solutions in Python and converted them into a script using the cx_Freeze lib.

I would like to implement the execution of this script in the middle of the execution of the UiPath project, however I noticed that with the Open Application and Start Process the script opens and closes seconds later, without being finished (as if it opened the script session and when moving to the next activity to end).

We work with a UiPath studio and an unattended robot via Orchestrator… When I run it here in Studio for testing, the script waits until completion, but when I publish the package and run the unattended robot, the script opens and closes without finishing .

I know about the existence of Python Activities in UiPath, but I don’t want to use them because the scripts are already ready and with cx_Freeze I can isolate the Python project in a venv folder along with its libraries.

Has anyone gone through something similar? Could you help me understand what could be happening?

Thank you colleagues.

@guintherlanger Did you find a solution for it? I found your solution really interesting.
I was having problem to isolate the virtual environment using python scope since UiPath doesnt support it and I create a workaround for it running my script in subprocess inside my python script. If its still useful for you I can share!