Create a Power Automate Desktop flow

Desktop flows are used to automate tasks on the Web or the desktop. Using Power Automate Desktop you can automate tasks on the desktop as well as the Web. Alternatively, you can use the two legacy methods of creating desktop flows: Windows recorder (V1) and Selenium ID.

Trigger the console from the portal

  1. To create a desktop flow in Power Automate Desktop, open the app and select New Flow.

    New flow button

  2. Enter a name for the desktop flow, and click OK.

    build flow dialog box

  3. Create the flow in the flow designer and press Ctrl+S to save the flow. Close the flow designer and the flow will appear in the console.

    console flow

Design a flow in Power Automate and Power Automate Desktop

  1. Create a new folder on the desktop, and name it Countries.

  2. Go to, select My flows, then +New flow, and Instant cloud flow.

    My flows instant blank

  3. In the dialog box, enter a cloud flow name, select Manually trigger a flow, and then select Create.

    manually trigger flow

  4. Select + New step.

    new step

  5. Search for power automate desktop, and select the Run a flow built with Power Automate Desktop action.

    action search

  6. In the action, under Run mode select Attended - Runs when you're signed in and under Desktop flow select Create a new desktop flow.

    run Windows recorder (V1) flow properties

  7. Enter a desktop flow name or one will be generated and select Launch app.

    Dialog box

  8. A message from the browser may appear, asking whether to allow to open an application. Allow this action to continue to Power Automate Desktop.

    browser open application

  9. In Power Automate Desktop, open the Variables pane, select + and select Input to add a new input variable.

    add new input variable

  10. Configure the variable as follows:

    • Variable type: Input
    • Variable name: CountryName
    • Data type: Text
    • Default value: France
    • External name: CountryName
    • Description: This is the country name input variable.

    edit variable input

  11. Add the Get current date and time action and set Retrieve to Current date only. Select Save to add the action to the Power Automate Desktop workspace. This action retrieves only the current date, and stores it in a variable.

    get current date and time action properties

  12. Add the Convert datetime to text action. In Datetime to convert, select the variables icon and double-click on %CurrentDateTime% in the pop-out to add the variable to the field. For Format to use set Custom, and enter MM-dd-yyyy in Custom Format. This action converts the datetime variable to a text variable, while also converting the date to the specified format.

    convert datetime text

  13. Add the Get special folder action. The Special folder name will default to Desktop. This action stores the location of the current user's Desktop in a variable.

    get special folder action properties

  14. Add the Create Folder action and set Create new folder into to %SpecialFolderPath%\Countries and New folder name to %CountryName%. This action creates a new folder with the specified name, in the specified location.

    create folder action properties

  15. Add the Write text to file action and use the variables pop-out to set File path to %SpecialFolderPath%\Countries\%CountryName%\%FormattedDateTime%.txt.

  16. Set Text to write to This text was written by Power Automate Desktop. This action writes the specified text to a text file on the current user's desktop, and sets the filename to the current date.

    This action writes the specified text into a text file.

    write text file action properties

  17. Add the Get files in folder action and set Folder to %SpecialFolderPath%\Countries\%CountryName%. This action retrieves a list of the files in a specified folder.

    get files folder action properties

  18. In the Variables pane, create two Output variables as follows:

    • Variable type: Output
    • Variable name: FileCount
    • External name: FileCount
    • Description: This is the file count output variable.


    • Variable type: Output
    • Variable name: FilePath
    • External name: FilePath
    • Description: This is the file path output variable.

    new output variable

    new output variable 2

  19. Add two Set variable actions and configure them as follows:

    • Set variable: FilePath
    • To: %SpecialFolderPath%\Countries\%CountryName%\%FormattedDateTime%.txt


    • Set variable: FileCount
    • To: %Files.count%

    set variable action properties

    set variable action properties 2

  20. Select Save to save the flow and close the flow designer.

    save complete flow

  21. Back in Power Automate, in the dialog box select Keep Working.

    pad portal dialog box keep working

  22. Select the new desktop flow in the action, and enter Greece into CountryName.

    run desktop flow action properties 2

  23. Select Save to save the flow and then select Test.

    save test flow

  24. Select I'll perform the trigger action. and Test.

    test flow

  25. When Power Automate connects to Power Automate Desktop, select Continue, then Run Flow and then Done.

    run flow pop out 3

  26. When the flow finishes running, all actions will have a green checkmark icon and a notification will confirm that the flow ran successfully.

    successful flow run

  27. Select the Run a flow built with Power Automate Desktop action to open its inputs and outputs. The values of the two variables, FileCount and FilePath, were returned from Power Automate Desktop. Similarly, any output variables may be used elsewhere in the flow.

    variables values

  28. Check the Countries folder on the desktop. A folder with the name Greece has been added, and contains a text file with today's date.