How to Invoke a Workflow using Invoke Code activity

studio
invoke

#1

Team,

Please help to know how can i invoke a workflow using code?

   Dim argInvokeFile As Uipath.Core.Activities.InvokeWorkflowFile = New Uipath.Core.Activities.InvokeWorkflowFile

    Dim activity As System.Activities.WorkflowInvoker 
    Try
    argInvokeFile .WorkflowFileName ="Search.xaml"
    activity = New WorkflowInvoker(argInvokeFile ) 
    activity.Invoke()
     
    Catch ex As Exception
     throw
    Finally
       argOpenBrowser1 = Nothing
       activity = Nothing
    End Try

Kindly help to know how i pass arguments within the code as well, Thanks for your support.


#2

Why are you trying to reinvent something that already exists?

RD


#3

In the existing method do we have control over the object? and
one more query do the object get destroyed once the execution is over?

The reason I’m asking is if i debug a project with 20 odd xaml uipath stops responding with a msg box “workflow designer” and
error msg “MemoryOut exception” I don’t know the exact error message but i get something like this.

I have to close the application and open again.
pls help to know to why i get this message.

Thanks