Change connections in MuleSoft Composer hassle free!

Meghesh Shenoy
Another Integration Blog
5 min readMar 22, 2023

“Automate Anything, Empower Everyone, and Deliver Success Now!” You may have come cross these particular phrases recently. It makes sense because as of late, MuleSoft truly provides users with easy access to build and deliver End-to-End Automation. Now you can integrate legacy systems with modern day applications without writing a single line of code; allowing users to integrate multiple systems seamlessly.

In this module we will learn how we can utilize the newly launched Sharing(Import/Export) of MuleSoft Composer Flows feature to change the connections that are being used in each of the connectors in MuleSoft Composer Flow — hassle free!

Problem Statement:
Currently we cannot segregate flows or invoke one flow from another Composer flow, dissimilar to the capabilities of Autolaunched Flows (Salesforce Lightning Flow Types where one can create reusable flows and then can invoke the reusable flow from any other type of flow or even from Apex code). So for many business use cases we end up creating very long MuleSoft Composer flows, and the most time consuming task is changing the connections! In a traditional use case, once Admins and business users are confident that their Composer flow is fit to be used and operate on production data after vigorous testing, they must go through the process of moving connections from sandboxes to production. Traditionally users would have to scroll through their entire Composer flow and change the connections.

Solution:
Well now you don’t have to necessarily scroll through your lengthy MuleSoft Composer flows to change the connections — you can simply use the new “Sharing MuleSoft Composer Flows” feature where you can simply download and upload the same flow to the same MuleSoft Composer instance or any other MuleSoft Composer instance!

In the following demonstration, we will be changing our connections that are pointing to sandboxes to that of the production.

The below image is the MuleSoft Composer flow which we have built. It currently uses connections pointing towards sandbox instances of each external system (in our case it’s Salesforce). For Slack, we can simply create a channel in the existing Slack workspace for testing purposes and when it’s ready to be used with production data we can simply switch the channel in the Slack connector.

Composer Flow with Sandbox connections

Step 1: Drag your cursor to the top right corner to the top right corner and click on the settings icon

Step 2: Click on the Export Option which would download the JSON file containing all the details of the current MuleSoft Composer flow.

Step 3: Go back to the Home Page and click on the “Create Flow from Scratch” option. The reason we are creating a new flow and importing the newly downloaded JSON file into it is because if you imported the JSON file into an existing flow, it would override and delete all the components present in the current flow. For this reason it is recommended to create a new empty MuleSoft Composer flow.

Step 4: Click on the Import option. Once clicked it will prompt you to upload a valid JSON file containing information about the MuleSoft Composer flow.

Step 5: Click on the “Select Flow” button and upload the valid JSON file which we previously downloaded.

Step 6: Once uploaded it will prompt you to select the connections which are already present in your MuleSoft Composer instance with the target system.

Step 7: You can either create a fresh new connection, or just select a pre-existing connection from the dropdown of each Connector. For our use case we will choose the connections pointing towards the production instance of each external system.

Step 8: Click on the “Import Flow” button.

Step 9: Once the flow is imported into the MuleSoft Composer instance it will revalidate all the connections.

If all the connections are valid then you can save the imported MuleSoft Composer flow without any errors!

And, there you have it! We have successfully changed the connections in our MuleSoft Composer flows without having to scroll through a complex Composer flow. This is the true power of MuleSoft Automation where we can now DESIGN, BUILD, and SHARE our MuleSoft Composer flows without having to write a single line of code and all just by using point and click.

Want to see this in action? You can watch the demo video below:

--

--