Hello everyone!
Does anyone have any idea how I could run a python script located in Google Colab from UiPath? what happens is part of the process that I am automating needs that python script to be executed, which takes information from several sheets of google Sheet. I know that UiPath can execute python script, but I would like the script to stay in google colab for user ease, in case he needs to make any changes to the python code
Hello @Juan_Esteban_Valencia, try this set of steps:
- Set Up Google Colab:
- Create and configure your Python script in a Google Colab notebook.
- Ensure that your Google Sheet data is accessible from the Colab notebook.
- Google Colab Sharing:
- Share the Google Colab notebook with the necessary permissions to a Google account or service account that UiPath can use for authentication.
- Google Drive Integration:
- In UiPath, you can use the “G Suite” activities or Google Drive API to interact with Google Drive. Install the necessary package for Google integration.
- Authenticate UiPath to access Google Drive using the Google account or service account mentioned in step 2.
- UiPath Script:
- In UiPath, create a workflow where you can use the “Download File” activity to download the Colab notebook (
.ipynb
file) from Google Drive to your local machine.
- Execute Colab Script:
- Use the “Invoke Python Method” or “Run Python Script” activity in UiPath to run a Python script.
- In this script, you can use Python libraries like
nbconvert
to convert the downloaded.ipynb
Colab notebook into a.py
Python script. - After conversion, execute the Python script using the Python activity. This way, you’re running the Python script originally located in Google Colab from UiPath.
- Result Handling:
- If your Python script produces any output files or results, you can use UiPath to process or upload these results back to Google Drive, a cloud storage service, or another destination as needed.
Cheers!
1 Like