Max the mule standing next to text that says, "How to Configure Error Handling in MuleSoft Composer."

How to Configure Error Handling in MuleSoft Composer

By

MuleSoft Composer is the fastest and easiest way to connect apps and data for business teams, in partnership with IT. With the long-awaited error handling feature that Muleys are excited about, you can build more robust and resilient automation. You can further automate your flows, get real-time notifications on failures, mark failed records for reprocessing, and do a lot more.

Now, you can take additional action when an error occurs in the Composer flow. For example:

  • Continue processing in a For-Each loop when an error occurs within the loop iteration.
  • Continue processing in a flow with a series of actions.
  • Customize your own alert when an error occurs (emails, Slack).
  • Update and mark record status when it fails with an error message to easily identify the record, make corrections, and mark it for retry.
  • Evaluate error types/descriptions, and have a flow branch to notify the correct team and/or automatically fix the issue.
  • Handle more complex scenarios, as Error Handler supports current Composer features (If/Else, For-Each, and Nested Error Handler).

Watch this short demo video to learn more:

How does an admin configure this?

You’ll see a new step, Error Handler (Beta), under the +Plus New Step – Logic section. Inside this Error Handler, you can add/drag any steps to watch for errors and configure the On Error section to add steps to handle the error.

This shows the new Step (Error Handler) under the logic section in the add new step (left). This also show the Error Handler block details (right).

Watch section:

  • You can specify steps to watch for errors. This can be connections and/or logic.
  • You can create or move one or more steps in this section.
  • If any error occurs, it will stop the processing of steps in this section (Watch) and jump to the On Error section.

This shows the Error Handler Watch Section where 2 steps are added into the Watch section.

On Error section:

  • The On Error section will start processing if an error occurs in the Watch section.
  • If any error occurs, it will jump to the On Error section.
  • You can create or move steps into On Error processing.

This shows the Error Handler On Error Section where 2 steps are added into the On Error section.

On Error – Condition to run:

  • There is one default On Error section, but you can add more with On Error conditions.
  • Here are the conditions you can set to run this branch:
    • All conditions must be met (AND)
    • Any condition can be met (OR)
    • Custom logic
    • None

The conditions to run criteria configuration for the On Error section.

  • Only one On Error section will be processed within one Error Handler when it meets the condition. The rest of the On Error will be skipped (in sequential order).
  • It’s best practice to leave the last On Error with None condition to catch any remaining condition (else).

This shows an simple example of Error Handler watching for errors and handling the error inside On Error.

On Error – After running:

  • ‘Continue’ or ‘Stop Flow’ after the error is handled in the On Error step.
  • ‘Continue’ will exit on the Error Handler block after processing all the steps in the On Error section and continue to the next flow step outside of the Error Handler block.
    • It will mark the flow in Run History as SUCCESS (if no other unhandled error occurs or another Error Handler block with After Running Stop).
  • ‘Stop’ will stop the flow after processing all the steps in the On Error section.
    • It will mark the flow in Run History as FAILED.

This shows the run history page where an error has occured.

Error data pill:

  • Each Error Handler block will create a set of error data pills:
    • Error Type
    • Error Description

This shows the Error Handler data pill (which can be used for mapping and logic just like any other data pills from the connectors).

  • The data pill (Error Handler) will show the step number of the Error Handler block. This way, you can identify where these data pills are from if you have multiple Error Handlers in your flow. In the below example, the flow has two Error Handler blocks.

This shows the Data Pills with multiple Error Hander block. The step number will make it easy to identify which steps they are in and identify the sets of Error Handler data pills.

  • These data pills can be used just like any other data pill for mapping, condition criteria, and custom logic.
  • It’s best practice to use the error data pills within the Error Handler On Error section, as these data pills may be blank if used outside of the Error Handler block if no error occurs.

Error Handler patterns: There are different kinds of Error Handler patterns available to meet your requirements.

  • Add all steps in one Error Handler.
    This pattern is useful if you have the same On Error process for any errors or if you can configure multiple On Error with error conditions to handle specific types of errors. Note: If any error occurs in the step inside the Watch section, the remaining steps in the same Watch section will not proceed.
  • Add more than one Error Handler in a flow, you can group steps into the Error Handlers or each step can have its own Error Handler.
    This pattern gives you the flexibility to easily configure specific On Error steps to handle the steps.
  • Put Error Handler inside a For-Each loop.
    This pattern allows you to continue the loop iteration if an error occurs inside the loop. You must set the On Error to ‘Continue’ after running. It’s best to add a step to update the failed record for troubleshooting and reprocessing, if needed.

Nested Error Handler:

  • This is an Error Handler block inside of another Error Handler Watch section.
  • It gives you an additional layer to handle error for specific steps.
  • After running, you can select one of these options:
    • Continue
    • Propagate
  • ‘Continue’ — Process On Error steps and Continue on the next step within the Parent Watch steps (that is, continue to step 9 – Action Create Task in Asana).
  • ‘Propagate’ — Process On Error steps and Push this error to the parent Error Handler as an Error. Stop processing steps in the Parent Watch steps and go to the Parent On Error section (that is, step 11 – On Error).

This shows how you can add a nested Error Handler block inside of another Error Handler block to deal with more complex error handling situation.

What admins should do next

Configure this new error handling feature in MuleSoft Composer today. Add the Error Handler to your existing Composer flows to further automate them—which ultimately means less work for admins when troubleshooting flow issues! Share this feature with your team and empower them to do the same.

Resources

Introducing Invocable Composer Flows.

Introducing Invocable Composer Flows: Automate End-to-End Across All of Salesforce

What are Invocable Composer Flows? MuleSoft Composer is an integration tool designed for admins, business analysts, marketers, salespeople, and team leaders. Using Composer, you can quickly and easily build flows to integrate systems and data and automate integration tasks. It’s a no-code tool you can use to build automations with only clicks. To further supercharge […]

READ MORE
Cloudy standing near a cliff and text that says, "Easy Integrations with Flow HTTP Callouts."

Integrations Are Easier Than Ever with Flow HTTP Callouts

Are you tired of waiting for IT resources to build out an integration to your supplier? Are you frustrated that your payroll system lacks reliable application programming interface (API) documentation, leaving your IT team to weed through JSON and just hoping it’ll work? Then Flow HTTP Callout is for you! This feature does the hard […]

READ MORE