title: Mule Subflow vs Processor-Chain
body: <p>What is the difference between Subflow and Processor-Chain in Mule?</p>
  
  <p>As far as I have used both are re-usable. Both makes the config more readable. Both execute synchronously. Both inherit the processing strategy and exception-strategy from the triggering flow.</p>
  
  <p>Processor-chain can be defined inside the flow as well as a global message processor.</p>
  
  <p>Apart from this how are they different in terms of behaviour and usage.</p>
  
  <p>Update:
  Example config with Named Processor Chain</p>
  
  <pre><code>&lt;flow name="man-flow" &gt;
          &lt;http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="myapp/collection-processor" doc:name="HTTP"&gt;
              &lt;byte-array-to-string-transformer&gt;&lt;/byte-array-to-string-transformer&gt;
          &lt;/http:inbound-endpoint&gt;
          &lt;expression-component doc:name="Expression"&gt;&lt;![CDATA[java.util.ArrayList list = new java.util.ArrayList();
              list.add("First String");
              list.add("Second String");
              list.add("Third String");
              payload = list;]]&gt;          
          &lt;/expression-component&gt;
          &lt;request-reply&gt;
              &lt;vm:outbound-endpoint path="split"/&gt;
              &lt;vm:inbound-endpoint path="processed"/&gt; 
          &lt;/request-reply&gt;   
          &lt;set-payload  value="#[payload.toString()]"/&gt;
      &lt;/flow&gt; 
  
      &lt;processor-chain name="sample-processor-chain"&gt;
          &lt;append-string-transformer message=" in splitter" /&gt;
          &lt;append-string-transformer message=" in processor-chain" /&gt;
      &lt;/processor-chain&gt; 
  
      &lt;flow name="splitter-flow"&gt;
          &lt;vm:inbound-endpoint  path="split"/&gt;
          &lt;collection-splitter enableCorrelation="IF_NOT_SET"/&gt;
          &lt;processor ref="sample-processor-chain"&gt;&lt;/processor&gt; 
          &lt;vm:outbound-endpoint  path="aggregate"/&gt;       
      &lt;/flow&gt;
  
      &lt;flow name="aggregator-flow"&gt;
          &lt;vm:inbound-endpoint  path="aggregate"/&gt;
          &lt;collection-aggregator  timeout="30000"/&gt;           
          &lt;vm:outbound-endpoint path="processed"/&gt;
      &lt;/flow&gt;
  </code></pre>