Hear from Salesforce leaders on how to create and deploy Agentforce agents.
Contact Us 1-800-596-4880

First Successful (<first-successful/>)

Iterates through a list of configured processing routes until one of the routes executes successfully.

If any processing route fails execution (throws an error), the router executes the next configured route.

If none of the configured routes execute successfully, the First Successful router throws an error.

Component XML

This component supports the following XML structure:

<first-successful
  doc:name="First successful"
  doc:id="vyaedo" >
  <!-- First Route -->
  <route>
    <!-- Processors -->
  </route>
  <!-- Second Route -->
  <route>
    <!-- Processors -->
  </route>
</first-successful>
xml

First Successful (<first-successful/>) attributes are configurable through the UI and XML.

Attribute Name Attribute XML Description

First successful (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

<route/> is a child element of First Successful.

Child Element Description

<route/>

Accepts one or more components as child elements. Multiple <route/> configurations are allowed.

Example

The following example shows a First Successful router configured with four processing routes:

1 The first route executes and fails because it tries to read a file that does not exist.
2 The second route fails because it tries to access a variable that does not exist.
3 The third route executes successfully and sets variable successfulRoute with value 3.
4 The fourth route is not executed because the First Successful router stops executing routes after one of them completes successfully.