Free MuleSoft CONNECT Keynote & Expo Pass Available!

Register now+
You are viewing an older version of this section. Click here to navigate to the latest version.

Studio Scopes

About Scopes

The message processors known as Scopes appear as processing blocks when you first place them on the Message Flow canvas (See: below).


Certain scopes (i.e., Poll, Message Enricher, and Until Successful) require you to embed no more than one message processor within the processing block (See: below). Variously, these scopes add functionality to the embedded message processor by:

  • triggering it periodically

  • enhancing its payload

  • triggering it until the associated event succeeds


Typically, the other sub-group of scopes (which includes Composite, Async, and Sub Flow) accepts more than one message processor (See: below).


In the case of Composite, the embedded building blocks are actually message sources (i.e., inbound endpoints) that listen in parallel on different channels for incoming messages (See: above, left). Whenever any of these receivers accepts a message, the Composite scope passes it to the first message processor in the flow, thus triggering that flow.

For the Async and Sub Flow scopes, the embedded message processors form a single, combined message processor (or event) sequence (See: above).

check Synchronous means that processing on the main flow halts, and all the message processors in the child flow execute before the parent flow resumes processing; in other words, no processing takes place in the parent flow while the synchronous child flow is executing. Asynchronous means that as soon as the child flow receives a message, it immediately sends one copy of that message to the next message processor in the parent flow so that processing in the parent flow continues, essentially uninterrupted. The asynchronous child flow also starts processing another copy of the message with its own sequence of message processors. These two simultaneous processing branches continue independently until each completes.

The Async scope sits in the parent flow sequence, and when it receives a message, it sends a copy of the message on to the next message processor in the parent flow, while simultaneously (and asychronously) processing another copy of the message through its own sequence of embedded message processors (See: below).


The Sub Flow scope exists as a synchronous branch flow with respect to the parent flow (See: below). After it receives a message from a Flow Reference component, it processes that message through the entire sequence of embedded message processors, then passes the message back to the next message processor in the parent flow for further processing. This process repeats each time a Flow Reference component in the main flow "calls" the Sub Flow processing block.


Scopes Available in Studio

Scope Description



Creates a block of message processors that execute asynchronously while the rest of the flow continues to execute in parallel. For instance, you can populate an Async scope with a sequence of building blocks that perform logging so that logging does not slow down the rest of the application flow.

For specific information on configuring the Async Scope, see the Async Scope Reference page.


Composite Source

To accept incoming messages from multiple input channels, place two or more message sources (also known as receivers) into a Composite Source. A message entering the Composite Source on any supported channel triggers the processing flow.


Message Enricher

Appends information to a message, often using an expression to determine what part of the payload to evaluate so as to return an appropriate value to append to that payload. For example, the expression can evaluate a ZIP code and then append the associated City and State to the payload. The enriched payload is then passed to the message processor embedded within the Message Enricher processing block.


Until Successful

Attempts, at a specified interval, to route a message to an embedded message processor until one of the following occurs:
* it succeeds
* the maximum number of retries is reached
* an exception is thrown

Thus, Poll can prove useful in sending messages to resources, such as shared printers, which might not always be immediately available.


Sub Flow

Scope Configuration

Depending on the particular scope, configuration requires between two and four steps.

Place the Scope on the Message Flow Canvas

Drag the icon of the scope you want to implement onto the Message Flow canvas. Note that all six scopes initially appear as empty "processing blocks." The following table lists requirements for placing and populating scopes:

Scope Placement Requirements Population Requirements


Must be placed within the parent flow

Must be populated with a sequence of message processors which execute asynchronously with respect to the parent flow


Must be placed at the start of the parent flow (i.e., must act as a message source)

Must be populated with more than one message source

Message Enricher

Must be placed within the parent flow

Must be populated with exactly one message processor, to which the message enricher hands off the enhanced message


Must be placed outside the parent flow sequence, then called by a Flow Reference in the parent flow

Must be populated with exactly one message processor, which the poll triggers at a specified interval

Sub Flow

Must be placed outside the parent flow, then referenced one or more times by Flow Reference components within the parent flow

Must be populated by a sequence of message processors, which execute synchronously with respect to the parent flow

Until Successful

Must be placed within the parent flow

Must be populated with exactly one message processor, which the scope triggers until the event is successful

Configure the Embedded Message Processors

The setup procedures for all embedded message processors or message sources are the same as for non-embedded building blocks.

Configure the Parent Scope

In all cases, except for Composite Source,which does not require any configuration, double-click the scope’s icon to open its Properties pane. Sub Flow supports optional documentation only. The other four scopes require or permit varying degrees of additional configuration.

Connect the Child Flows

For Sub Flow and Poll, which exist as child flows outside the parent flow, you must insert and configure one or more Flow Reference components into the parent flow at the points you want to call these child flows.