Guardar en una variable boolean si un workflow is executed or not

Hola,
estoy necesitando saber si un workflow se ha ejecutado para poder guardarlo en una variable boolean en caso de que sí para poder ejecutar enseguida un otro workflow

como poder hacer eso?

@maria14,

What do you mean by workflow? Is it a workflow file in the same project or do you mean another bot?

Hi @maria14

You can create an asset in the Orchestrator with Boolean type. You can update the asset as your conditions in your workflows by using Set asset activity to update the value. Use get asset activity in other workflow to get the value of asset.

Hope it helps!!

a workflow file in the same project, I need to know if it is executed so the bot can continue to do some other activities then

@maria14,

You have two approaches to handle exceptions in a child workflow and control the execution flow in UiPath.

Using Invoke Workflow File Activity

  1. Invoke the Workflow:
  • Use the Invoke Workflow File activity to call your child workflow.
  • If the invoked workflow throws any exception, the further activities in your main workflow will not execute.
  • If no exception occurs, the main workflow will continue to execute.

Using Try-Catch Block within Child Workflow

  1. Wrap Child Workflow in Try-Catch:
  • In your child workflow, surround all activities with a Try-Catch block.
  • Declare an output argument of type System.Exception in the child workflow (let’s call it out_Exception).
  1. Handling Exceptions:
  • Within the Catch section of the Try-Catch block, assign the caught exception to the out_Exception argument.Example:
Try
    ''Your activities go here
Catch ex As Exception
    out_Exception = ex
End Try
  1. Invoke Child Workflow in Main Workflow:
  • In the main workflow, use the Invoke Workflow File activity to call the child workflow and map the out_Exception argument.Example:
Invoke Workflow File: ChildWorkflow.xaml
Arguments: out_Exception (Direction: Out)
  1. Condition Check in Main Workflow:
  • After invoking the child workflow, use an If condition to check if out_Exception is Nothing (no exception occurred).Example:
If out_Exception Is Nothing Then
    ' Continue with the rest of the workflow
Else
    ' Handle the exception (e.g., log it, throw it, etc.)
End If

By following these steps, you can effectively handle exceptions within a child workflow and control the subsequent execution flow in your main workflow.

LLM helped me to rephrase the answer.

why to use assets in this case?

I thought you are trying to make connection between two processes, so that I have advised to use Assets… @maria14

@maria14

just create an argument of type boolean and send it out…if the workflow is executed the boolean variable assigned to it will be set to true inside workflow else by default it would be false

cheers

Hi @maria14

Let’s say your main workflow have a try cath block and you are calling multiple workflows one after the other using invoke workflow activity

If the execution of all the workflows are mandatory - You don’t need to handle exceptions separate. You can call one after the other. Process will continue only if the workflow execution is successful. If any error occur in any workflow - it will throw exception and reach main flow catch block


lets say you want to decide the flow based on the success or failure of a workflow - the workflow should contain Try Catch Block and output arguments. Usually 3 output arguments such as bool_ApplicationException , bool_BusinessException and str_ExceptionDetails

Rite after the workflow - you need to put some condition to check whether any technical or business exceptions are there from the previous workflow and you can modify your main flow accordingly. Make sure you are using these arguments in the main flow as separate exception wont be bubbled up to main flow

Hope it helps