What the error means
SessionExistsForTheUserWhenUnattended is a Power Automate desktop flow error for unattended runs. Microsoft's queue errors article says it occurs when you try to run an unattended desktop flow on a target machine where the user used in the desktop flow connection is signed in. Microsoft's error code table adds the important detail: check that you aren't logged in with the same user, regardless of the state of the session.
The reason is how unattended runs work. Microsoft's unattended runs guide explains that Power Automate creates a new Windows session for each unattended run, using the credentials in the connection, runs the flow in that session and then signs it off. Unattended desktop flows therefore need a machine with the connection's user signed out. If that user already has a session on the machine, active, locked or disconnected, Power Automate cannot create its own session for the same user and the run is refused.
The code commonly appears as a suberror of NoCandidateMachine, because the run waits in the queue for a machine it can use.
Common causes
- The connection's user is signed in on the target machine with an active session.
- The connection's user has a locked session on the machine; Microsoft says a locked session leads to this error.
- The user's session is disconnected but not signed out. Microsoft reports this state with the related code UnattendedUserSessionDisconnected, and a locked one with UnattendedUserSessionLocked.
How to fix it
1. Sign the connection user out of the machine
Sign out the session that belongs to the user in the desktop flow connection on the target machine. Locking or disconnecting is not enough; the session has to be signed out. Then run the cloud flow again or wait for the queued run to start.
2. Confirm that no session for that user remains
Microsoft's resolution is to sign out and confirm you aren't signed in with the same user on the machine. As a general step, you can list sessions from an elevated Command Prompt on the machine with the Windows command below and check that the connection's user is not listed:
query user3. Turn on session reuse if a signed-in session must stay
If you need the user to stay signed in, Microsoft documents reusing the Windows session for unattended runs. Sign in to Power Automate, select Monitor > Machines, select the target machine or machine group, select Settings in the command bar and enable Reuse sessions for unattended runs. After a run the session is locked and Power Automate can reuse it. Machines added to a group inherit the group's setting. Reusing sessions isn't supported on machines that allow users to have multiple sessions.
4. Use a dedicated account for unattended runs
This is a general step. Keep the account used by unattended desktop flow connections for automation only, and tell administrators not to sign in to the machine with it. That prevents a test or maintenance sign-in from blocking scheduled runs.
If nothing works
If the run still fails, check the other suberrors on the run's queue events: UnattendedUserSessionDisconnected and UnattendedUserSessionLocked need the same sign-out fix, while UIFlowAlreadyRunning means another desktop flow is already running. The Power Automate desktop flows getting started guide explains attended and unattended run modes and the licence each needs.
What we checked
Three Microsoft Learn pages were read. "Troubleshoot desktop flow run queue errors" defines SessionExistsForTheUserWhenUnattended, says a locked session leads to it, and gives the sign-out resolution. "Error code occurs when running an attended or unattended desktop flow" lists the code as an unattended error regardless of session state. "Run unattended desktop flows" explains that unattended runs need all users signed out and documents the Reuse sessions setting and its limitation. The error was not reproduced for this page.
Last checked: 2026-11-21.