Trigger desktop flows from cloud flows

Prerequisites

Important

Gateways for desktop flows are now deprecated except for China region. Switch to our machine-management capabilities. Learn more

  • To trigger desktop flows through Power Automate, you have to use machines or machine groups. Machines are physical or virtual devices that are used to automate desktop processes. Machine groups allow you to organize multiple machines together to help distribute your automation workload.

    As an alternative to the machines, you can use the on-premises data gateway. The gateway is an enterprise-grade secure connection between Power Automate and your device.

  • A work or school account.

    Important

    You must use the same work or school account to set up the gateway, to sign into Power Automate, and to log into your Windows device.

Trigger a desktop flow from a cloud flow

  1. Go to flow.microsoft.com and sign in with your credentials. In Power Automate, select My flows. Select + New flow, and from the drop-down select Instant cloud flow.

    Screenshot of the option to create an instant cloud flow.

    Alternatively, you can select Automated cloud flow to create a flow that is triggered by a specific event, like the creation of a new file in an OneDrive for Business account.

    Screenshot of the Build an automated cloud flow dialog.

  2. Enter a name for the cloud flow, otherwise one will be automatically generated. Select Manually trigger a flow and then select Create.

    Screenshot of the Build an instant cloud flow dialog.

  3. Select + New Step.

    Screenshot of the New step action.

  4. In the Choose an action prompt search field, enter Power Automate for desktop. Under Actions, select Run a flow built with Power Automate for desktop.

    Screenshot of the Run a flow built with Power Automate Desktop action.

  5. If you haven't already created a desktop flow connection, the action will prompt you to create a new one. You can find more information regarding desktop flow connections in Create desktop flow connections.

    Screenshot of the fields of a new desktop flow connection.

  6. In the action parameters, set Run mode to Attended - Runs when you're signed in, and in the desktop flow drop-down select Create a new desktop flow.

    Screenshot of the fields of the Run a flow built with Power Automate Desktop action.

  7. Enter a name for the desktop flow and select Launch app.

    Screenshot of the Build a desktop flow dialog.

  8. A message from the browser may appear, asking whether to allow flow.microsoft.com to open an application. Allow this action to continue to Power Automate for desktop.

    Screenshot of a browser message asking whether to open an application.

  9. The Power Automate Console creates a desktop flow with the selected name and opens the flow designer to edit the new flow.

    Screenshot of the flow designer.

  10. Optionally, create input/output variables to pass data back and forth from the Power Automate web portal to your desktop flow. In the Variables pane, select + to add an input or output variable.

    Screenshot of the option to create a new input variable.

  11. To create an input or output variable, the New input/output variable dialog requires filling in the fields as follows:

    • Variable name: The name of the variable in the flow.
    • Data type: The type of the variable: text, number, boolean, custom object, list or datatable.
    • Default value: The default value when the flow runs from the Power Automate flow designer or the Power Automate console.
    • External name: The name of the variable used outside the flow designer. The external name is the name that will appear in the cloud or desktop flow designer while calling the flow.
    • Description: A description of the variable that will appear in the cloud or desktop flow designer while calling the flow.
    • Mark as sensitive: Defines whether to mark the variable as sensitive or not. You can find information regarding sensitive variables in Sensitive variables.

    Screenshot of the Add a new input variable dialog.

  12. Create an input variable to pass data from cloud flows to your desktop flow. The variable can be used anywhere in the desktop flow.

  13. To pass data from your desktop flow to a cloud flow, create an output variable.

  14. Back in the Power Automate portal, any input variables appear as fields in the Run a flow built with Power Automate for desktop action.

    Note

    If an input variable contains sensitive data, you may want to obfuscate or omit it from the logs. To find more information regarding sensitive text inputs, refer to Manage sensitive input like passwords.

    Note

    The limit of the input size for a desktop flow is 2MB (1MB for Chinese regions)

    Screenshot of the input variables in the Run a flow built with Power Automate for desktop action.

  15. Output variables from desktop flows can be used in most cloud flow actions.