DEV Community

shadowb
shadowb

Posted on

How to run python3 using Power Automate Desktop.(Step Wise Guide)

Hi Folks, This blog is about how can we run a python3 script using Power Automate.
As of now, Power Automate desktop supports Python 2.7 which has limitations.

Prerequisites :
1 - You need to have PAD installed. (obviously)
2 - Python3

Step 1 - Create A flow with any Name that you like.

Step 2 - Go to Action and search for "Open CMS Session".

Step 3 - Inside that give the current working directory as a Parameter.

Image description

Step4 - Again search for "Write to CMD Session" in actions and drag it under "Open CMD Session"

Image description

In "Write to CMD Session" give the command to run your python3 script.
example: cd.\PyProjects&& cd.my_script.py

Image description

Step 5 - Now again go to Actions and search for "Read from CMD Session" It will help you to see the output that is displayed on CMD.

Image description

Image description

As the Parameter just pass the instance of "Open CMD Session"

Now Save and Test your flow.

If you face any problem feel free to comment your questions.

Top comments (0)