Contact Us 1-800-596-4880

Use a published RPA Process in Salesforce Flow

Publishing an invocable run configuration in RPA Manager, creates an External MuleSoft Service in Salesforce. The service’s name consists of the name of the RPA Manager automation project without the blanks, followed by a '10'.

To use your process in a Salesforce Flow, follow these steps:

  1. Create a new flow. In this example we use a screen flow for illustrational purposes.

  2. Create a resource for the process execution input:

    New Apex-Defined variable resource for the process execution in Flow Builder

    Field

    Value

    Resource Type

    Variable.

    API Name

    Name of this resource; for example ProcessParameters.

    Data Type

    Apex-Defined.

    Apex Class

    Apex class ExternalService<RPA Project Name>10_ProcessExecution; for example ExternalServiceExampleProcess10_ProcessExecution`

  3. Use a screen to set the input parameters for debugging purposes:

    Screen configuration for input parameters in Flow Builder

  4. Assign all required values to the process parameters:

    Assignment of the input paramters from the screen to the process execution resource variables in Flow Builder

    The variable names are the same as the Activity Parameter names defined in RPA Builder:

    Activity Parameter definition for the example process in RPA Builder

  5. Choose the Start Process Action. You can filter for your process by name.

    Process Start Type

    Application

    Start Process V2

    If you use this endpoint, you must provide a process execution ID. This ensures that the process starts only once, even if it is called multiple times. For example, in case of network issues that prevent the return of the server’s answer, the client resends the request. That might generate duplicates or interfere with the original process.

    Start Process Non Idempotent V2

    If you use this endpoint, RPA Manager provides a new process ID for each call.

Start and status action list for the example process in Flow Builder

  1. Configure the action by filling the body with the resource that you defined earlier:

    Configuration of the Start Process Non Idempotent V2 action using the process execution resource variable as body in Flow Builder

  2. Get the execution status for the first time:

    Configuration of the Get Process Execution Status V2 action using part of the 201 output of the Start Process action as execution ID in Flow Builder

  3. Create a resource for the execution status:

    New Apex-Defined variable resource for the process execution status in Flow Builder

  4. Create a resource for collecting all states that the started process returns while it runs:

    New Apex-Defined variable collection resource for all process execution statuses in Flow Builder

  5. Add the first returned status to the status collection:

    Addition of a process execution status to resource collection in Flow Builder

  6. Since the run time of a process is not known, add a loop over all returned statuses:

    Configration of a loop using the collection as iteration counter

  7. To check for the current status, define three text constants: ìsStarted, running, error.

  8. Add a decision element:

    Configuration of a decision using text constants to check for the current execution status in Flow Builder

  9. If the returned status is not Success, add the current status to the loop collection:

    Addition of the process execution status to resource collection in Flow Builder

    This repeats until the process finishes and the status is Success. In this example, the error handling is omitted for the sake of simplicity.

  10. Get the final result and store the output values manually:

    Configuration of the Get Process Execution Status V2 action using part of the 201 output of the Start Process action as execution ID in Flow Builder

  11. Add a screen to view the results for debugging purposes:

    Screen configuration for displaying the process output in Flow Builder