How to reuse Terminal Connection

OutputConnection: optional, one may specify an output variable (of type TerminalConnection) in order to be used later in other terminal sessions.

How to use terminal connection in another workflow.
i have created a variable in outconnection and passed it to existingconnection of another terminal but its not working, any help on these??

1 Like


What does the error say and do you have any screenshots? As far as if there is a problem with UiPath passing Terminal session variables as arguments, that I am not sure about. But, if it’s an issue with your code maybe I can help.

If terminal variables indeed can not be passed, then a workaround is to pass the connectionstring as a string. You can pass that by doing terminalVariable.ConnectionString


1 Like

Hi Claytonm,

then a workaround is to pass the connectionstring as a string. You can pass that by doing terminalVariable.ConnectionString
Can you brief on these topic with example if possible.


These the error which i am getting i have tried to pass the out connection variable to workflow but its not working.

“message”: “Terminal Session Faulted”,
“level”: “Verbose”,
“logType”: “Default”,
“timeStamp”: “09:13:46”,
“processVersion”: “1.0.6659.21423”,
“fileName”: “Terminal_1StepLogin”,
“jobId”: “7200e74e-7a0e-4abc-bd91-b649b8abc029”,
“robotName”: “CSCADMIN”,
“activityInfo”: {
“DisplayName”: “Terminal Session”,
“State”: “Faulted”,
“Activity”: “UiPath.Terminal.Activities.TerminalSession”,
“Arguments”: {
“ConnectionString”: “”,
“DelayMS”: “1000”,
“TimeoutMS”: “50000”,
“ExistingConnection”: “”,
“ContinueOnError”: “False”,
“OutputConnection”: “”

1 Like


From the error, it shows that your ConnectionString is empty. Make sure you have set the right properties for your connection. If you are passing terminalVariable.ConnectionString as an Argument to a string variable in your workflow, you will need to place that variable in the ConnectionString property shown in the below screenshot:

Hope that helps.


1 Like

Hi ClaytonM,

Thanks for guidance ,as i have problem with passing my existing connection to another terminal through a variable using existing connection property.

But finally i have successfully passed the existing connection to other terminal session :slight_smile:

Can you please help me how did you pass existing session to invoked workflow.
I am having similar issue and i am not able to resolve it.

Hi @Nilesh

At the first terminal session it will creat a connection string then you can create a variable for output connection property in that connection and make use of the variable when ever you are passing the connection.



Hi @balu
How did you achieve to pass existing connection to other workflow?

In my case OutputConnection variable comes null so I can not pass it to other workflows. Do you mean using both output connection variable and connection string together?

@RSalamow yes at first you need to provide connection string and create a variable in output connection property, next where ever u need these connection u can pass this variable to existing connection property.


@balu I somehow have the same issue as @RSalamow.

I establish a connection in Main.xaml, and then i create a variable within OutputConnection. This variable is passed to an argument (another .xaml) where I want to continue the proces within the same terminal session. So the argument is inserted into ExistingConnection.

But when the robot comes to execute the terminal activities, I get the error: Terminal Session: No connection specified

Note that the CloseConnection is checked by default :face_with_raised_eyebrow:

Link to documentation