Skip to main content

Route Conditionally Through an RPA Process Flow

Learning Objectives

After completing this unit, you’ll be able to:

  • Route flows in an RPA process using Gateways.
  • Add variable values to RPA flows using Activity Parameters.
  • Block RPA process flow execution using User Tasks.
  • Get and set activity parameters in a User Task.

Before You Start

This module builds on MuleSoft RPA Builder Basics. In that module, you learn how to build MuleSoft RPA business processes in MuleSoft RPA Builder, so make sure you complete it before you continue.

In this module, we assume your organization has purchased a MuleSoft RPA license. If your organization has not purchased a MuleSoft RPA license, that’s OK. Read along to learn how users perform the steps. Don’t try to follow the steps in a Trailhead Playground, because MuleSoft RPA Builder isn’t available in the Trailhead Playground.

In this unit and its associated walkthrough, you first learn how to pass in and set values that are shared across the entire RPA process implementation using activity parameters. Then, you learn how to use activity parameters to move conditionally between two or more branches of an Exclusive Gateway. Finally, you learn how to block an RPA process in a User Task to get input from a user or an external system.

Work with a Gateway

The Gateway element determines which path an RPA process flow takes when executing. It can have any number of output routes. In the following diagram, you see a Start Event connected to a Gateway. The Gateway has two different output routes.

The Gateway element determines which path an RPA process flow takes when executing. 

One output route flows to an RPA Bot Task to automatically carry out activities. The other route flows to a User Task to await manual user input.

When configuring a Gateway element in MuleSoft RPA Builder, you write conditional logic expressions to determine which path is taken. The first route with a true condition is taken. You typically use activity parameters to code the logic for each Gateway path. Activity parameter stores and shares values across the entire RPA process.
Only one path can be left with no conditional logic code. That path is considered the default path. If none of the conditions specified for the other paths evaluate to true, the default path is selected.

Block RPA Process Flow Execution with User Tasks

A common design pattern involves routing the Start Event immediately to a Gateway to decide if the RPA process should execute automatically or wait for user input. For example, you might have a rule where all orders more than a certain amount need approval from a manager. You implement this by conditionally testing this logic in a Gateway element. If the order amount is more than the limit, the flow is routed to a User Task. Then the RPA process waits for a user to claim the task and assign a value to the activity parameter before the flow moves to the next element in the RPA process flow. 

In this example, the RPA process will block until a user completes the User Task in MuleSoft RPA Manager. The User Task also lets a user set the values for other activity parameters to make more decisions later in the RPA process flow. You can also route the User Task to another Gateway element to decide which route the flow should take based on the activity parameter values set by the user in the previous User Task.

A Timer Boundary event can be added to the User Task. This allows the RPA process to automatically proceed with default values for activity parameters if a user does not claim and complete the task within a certain time. 

BPMN diagram with a User Task that contains a Timer Boundary event.

Walkthrough

Now that you’ve learned about Gateways and how to block a flow’s execution with User Tasks, take a look at the following video demonstration showing how to bring it all together. If you wish to follow along, check out the walkthrough instructions.

After you finish the walkthrough, here is an additional challenge for you to apply your new skill. A solution is provided in the next unit.

In this unit, you were introduced to ways to trigger a Start Event, route flows, add variable values using activity parameters, and configure user tasks using activity parameters.

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities