Power Automate Desktop Flows: Troubleshooting SessionCreationTimeout Errors

Table of Contents

Unattended desktop flows in Microsoft Power Automate offer powerful automation capabilities, allowing processes to run autonomously on target machines without direct user interaction. However, users may encounter failures during these unattended executions, specifically indicated by the error code SessionCreationTimeout. This error signifies a critical issue during the initial phase of an unattended run, preventing the flow from starting correctly on the designated machine. Understanding the root cause and applying the appropriate resolution steps is essential for maintaining reliable automation workflows. This article delves into the symptoms, underlying causes, and detailed steps to troubleshoot and resolve the SessionCreationTimeout error.

Symptoms

When your unattended desktop flows fail, reviewing the run history in the Power Automate portal will display an error associated with the specific flow run. The characteristic symptom of the issue discussed here is the presence of the error code SessionCreationTimeout. This code appears in the details of the failed run, clearly pointing to a problem occurring during the attempt to establish a user session on the target machine where the desktop flow is configured to execute. Other errors might occur during unattended runs, but the presence of SessionCreationTimeout specifically indicates a delay or failure in the Windows session creation process itself.

Power Automate Desktop Troubleshooting

The failure happens right at the beginning of the process. Instead of the flow actions starting, the system reports the timeout before any automation steps can be initiated. This prevents the flow from progressing and completing its intended tasks. Recognizing this specific error code is the first step in diagnosing the problem.

Cause

The core function of an unattended desktop flow is to log in to a target Windows machine and run automation steps within a user session, all without a physical user present or interacting. Power Automate Desktop’s underlying service is responsible for initiating this process. It attempts to create a new Windows session on the target machine using the credentials provided for the unattended run. This session creation involves several steps, including authenticating the user, loading their profile, and preparing the desktop environment.

Power Automate Desktop has a built-in time limit for this session creation process. By default, this timeout is set to 3 minutes. If, for any reason, the system takes longer than 3 minutes to successfully create a user session on the target machine, the Power Automate service will terminate the attempt and report the SessionCreationTimeout error. This timeout is a safeguard to prevent the system from waiting indefinitely if a session cannot be established.

Several factors can contribute to the session creation process exceeding this 3-minute limit. These can include network latency or congestion between the machine initiating the run (often via a gateway) and the target machine, resource constraints on the target machine (high CPU, low RAM, slow disk I/O), slow domain controller response, security software (antivirus, firewall) interfering with the login process, or even Windows Group Policies or startup scripts that significantly delay session initialization. Any delay in these crucial steps can push the session creation time beyond the default threshold.

Resolution

Addressing the SessionCreationTimeout error primarily involves ensuring that the session creation process can complete within the allowed timeframe. The first and most crucial step is to ensure that your Power Automate for desktop installation on the target machine is up-to-date. Microsoft frequently releases updates that include performance improvements and bug fixes that could potentially address underlying issues contributing to slow session creation. Always check for and install the latest version available.

If updating Power Automate for desktop does not resolve the issue, the most common solution is to increase the default timeout duration for the Windows session creation process. This allows the system more time to establish the session, accommodating potential delays caused by factors mentioned previously. This adjustment is made via the Windows Registry. Please note that modifying the Windows Registry should be done with caution, as incorrect changes can lead to system instability. It is highly recommended to back up the registry before making any modifications. The ability to adjust this timeout setting through the registry is supported in Power Automate for desktop versions 2.21 or later.

Here are the detailed steps to increase the session creation timeout:

  1. Open the Registry Editor:

    • Press the Windows key + R simultaneously to open the Run dialog box.
    • Type regedit in the text field.
    • Click OK or press Enter.
    • You may be prompted by User Account Control (UAC); click Yes to proceed.
    • The Registry Editor window will open.
  2. Navigate to the Power Automate Desktop Service Key:

    • In the Registry Editor, use the left-hand navigation pane to browse to the following path:
      Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Power Automate Desktop\Service
    • Locate the Service folder under Power Automate Desktop. If any of the intermediate keys (WOW6432Node, Microsoft, Power Automate Desktop, Service) do not exist, you may need to create them by right-clicking on the parent key and selecting New > Key. Ensure they are named exactly as specified.
  3. Create or Modify the SessionCreationTimeoutSeconds DWORD Value:

    • In the right-hand pane of the Registry Editor, right-click in the empty space.
    • Select New > DWORD (32-bit) Value.
    • Name the newly created value exactly SessionCreationTimeoutSeconds.
    • Double-click the SessionCreationTimeoutSeconds entry.
    • The Edit DWORD (32-bit) Value dialog box will appear.
    • Under “Base,” select Decimal.
    • In the “Value data” field, enter the desired timeout duration in seconds. The default is 180 seconds (3 minutes). You might try increasing this to 300 seconds (5 minutes), 600 seconds (10 minutes), or even higher if necessary, depending on how long the session creation typically takes in your environment. A value of 300 is often sufficient to overcome minor delays.
    • Click OK to save the change.
    Path Key Name Type Value Data (Decimal) Description
    HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Power Automate Desktop\Service SessionCreationTimeoutSeconds DWORD (32-bit) 300 (for 5 minutes) Maximum time (in seconds) for session creation.
  4. Restart the Power Automate Service:

    • The registry change requires the Power Automate service to be restarted to take effect.
    • Press the Windows key + R to open the Run dialog.
    • Type services.msc and press Enter or click OK.
    • The Services window will open.
    • Scroll down the list of services to find Power Automate service.
    • Right-click on Power Automate service.
    • Select Restart from the context menu.
    • Wait for the service to stop and then start again.

After completing these steps, attempt to run your unattended desktop flow again. The increased timeout value should provide the system with sufficient time to establish the Windows session, potentially resolving the SessionCreationTimeout error.

Additional Troubleshooting Steps

If increasing the timeout does not resolve the issue, or if you need to identify the underlying cause of the session creation delay, consider the following troubleshooting steps:

  • Check Target Machine Performance: Monitor CPU, RAM, and Disk I/O utilization on the target machine during an attempted unattended run. High resource usage can significantly slow down the login process. Ensure the machine meets or exceeds the recommended hardware specifications for running Power Automate Desktop and the applications it interacts with.
  • Verify Network Connectivity and Speed: Ensure there is a stable and reasonably fast network connection between the Power Automate environment (or Gateway) and the target machine. High latency or packet loss can delay the session establishment. Test network speed and reliability.
  • Review Windows Event Logs: Check the Application and System event logs on the target machine, particularly around the time of the failed unattended run. Look for errors related to Winlogon, User Profile Service, or Remote Desktop Services. These logs can provide clues about what is causing the delay during login.
  • Test Manual RDP Connection: Attempt to establish a manual Remote Desktop Connection (RDP) to the target machine using the same credentials configured for the unattended flow. Note how long it takes to log in and whether you encounter any errors or delays during the process. If a manual RDP connection is slow or fails, it points to a system-level issue independent of Power Automate.
  • Examine Security Software and Firewall: Antivirus or firewall software on the target machine can sometimes interfere with the session creation process. Temporarily disabling them (in a controlled environment and with caution) can help determine if they are the culprit. Ensure necessary ports for RDP (usually 3389) and Power Automate communication are open if firewalls are in use.
  • Investigate Group Policies and Startup Items: Domain or local Group Policies can enforce settings or run scripts during user login that might cause significant delays. Similarly, a large number of startup programs or services configured for the user profile can slow down session loading. Review and optimize these configurations.
  • Ensure Credentials Are Correct and Have Necessary Permissions: While less likely to cause a timeout specifically (often results in authentication errors), double-check that the username and password configured for the unattended run are correct and that the user account has appropriate permissions to log in to the machine and access necessary resources.
  • Check for Pending Windows Updates or Reboots: Sometimes, pending updates or required reboots can affect system performance and login stability. Ensure the target machine is up-to-date and has been recently rebooted.

By systematically working through these potential causes and applying the resolution steps, you can significantly increase the reliability of your unattended desktop flows and overcome the SessionCreationTimeout error.

Have you encountered this specific error? What steps did you take to resolve it, and did increasing the timeout value work for you? Share your experiences and insights in the comments below!

Post a Comment