Switch Session

The Switch Session block changes the current terminal session used during automation. This enables flows to alternate between multiple active sessions, provided those sessions have been previously connected using a compatible block (such as a Desktop UI block inside a sub-flow).

This block is especially useful when managing parallel interactions across multiple terminal windows or sessions in the same flow.

The Green Screen Recorder and building blocks are available with Enterprise plans.

Fully expanded, the Switch Session block shows the following properties:

image-20251203-073753.png

Note: The screenshot on this page uses the Elegance Design, introduced in 2025.3. If you are using an earlier version, your layout may look different.

Quick-start

  1. Drag Switch Session onto the canvas.

  2. Specify the basic parameters required for this block to operate: Terminal session type, Default timeout.

  3. Run the flow when it’s ready.

Building block parameters

Parameters
  • Block header: The green input connector triggers the block to begin execution. The green output connector triggers when the session has been switched successfully. You can rename the block title by double-clicking it and typing in a new title.

  • Terminal session type: Selects which terminal session to switch to. Leapwork supports sessions A–Z (uppercase) and allows switching between sessions within the same flow.

  • Error occurred: Triggers if Switch Session returns an error during execution, so you can branch your flow.

  • Default timeout: If unchecked, the timeout is 10 seconds unless changed manually. If checked, the flow’s Default timeout under Max. run time applies.

  • Timeout (sec): The maximum time spent switching sessions before giving up. This value is used when Default timeout is unchecked (default is 10 seconds unless changed manually).

Resources

Topic

Description

Flows FAQ

Common questions about creating, running, and managing flows in Leapwork.

Flows Troubleshooting

Guidelines and solutions for identifying and fixing issues that occur when building or running flows in Leapwork.