Skip to main content

Design and Test a Flow

Learning Objectives

After completing this unit, you’ll be able to:

  • Design a flow to automatically sync data from Salesforce to Asana.
  • Test your flow to ensure it syncs data as expected.

In this unit, you first learn how to use MuleSoft Composer to create a flow that automatically syncs customer service cases in Salesforce with tasks in Asana. Then, you test your flow to ensure it syncs data as expected.

By default, MuleSoft Composer validates your work and provides contextual in-app help every step of the way. For example, when you add a connection to a system, MuleSoft Composer tests the connection to make sure it works before you can proceed to the next step. Also, to simplify building your flows, MuleSoft Composer prompts you to complete required fields within each step.

As a best practice, when building a flow, add a few steps and test iteratively until you complete the flow. 

Note

If you have a large integration task, it’s recommended that you break up the task into manageable, bite-sized chunks, and then create a flow for each chunk. This enables you to more easily and quickly build, test, and run your flows to accomplish the task.

Take a look at this video demonstration showing how to connect Salesforce to Asana using MuleSoft Composer.

Design a Flow

Now you’re ready to design an integration flow that integrates customer service cases in Salesforce with tasks in Asana. 

Follow these steps to design a flow.

Launch MuleSoft Composer from the NTO org.

  1. Log in to your NTO org using your username and password.
  2. From the App Launcher, enter Composer and select MuleSoft Composer.

Create a new flow.

  1. Click Create New Flow.
  2. Click the pencil icon next to the default flow name.
  3. Name the flow Sync NTO Org Cases with Asana Tasks and click Save.

Create a trigger for the flow using the NTO org.

  1. Click Salesforce.
  2. Click Add new Salesforce connection.
  3. Name the connection NTO sandbox org.
  4. Select the checkbox This is a sandbox organization and click Create.
  5. Enter your NTO sandbox org’s username and password and click Log In.
  6. Click Allow to grant MuleSoft Composer the permissions to access your basic information, access and manage your data, and perform requests on your behalf at any time. MuleSoft Composer automatically tests the connection. If no error message appears, you have a successful connection, and the first step (trigger) of the flow appears.
  7. Click the pencil icon next to the default step name.
  8. Name the step Get case and click Save.

Configure the trigger to start the flow every time a case is created or updated in the NTO org.

  1. Click in the Choose an event that starts this flow field and select New or updated record.
  2. In the Object Type field, enter Case.
  3. Look at the Sample Output section, which shows fields and associated sample values from a case in the NTO org. This confirms that you're connected to the correct org and lets you know the structure of the data that is available in later steps of your flow.
    Step 1 of flow with trigger event and object type fields and Select Fields button.
  4. Click Save to save the flow.

Create and configure the first If branch to evaluate whether a case is high priority and requires engineering assistance.

  1. Click the plus icon to add a step.
  2. Click If/Else Block.
  3. Click Add Conditions. The All conditions must be met (AND) condition is selected by default.
  4. Select Priority as the field and Equals as the operator, and then enter High as the value.
  5. Click Add a condition.
  6. Select Requires Engineering Assistance as the field and Is true as the operator, and then click Save. If both these conditions are met, the next step in the first If branch (create Asana task) is executed.

Create the second step of the flow within the first If branch to handle cases that are high priority and require engineering assistance.

  1. Click the plus icon to add a step within the If branch.
  2. Click Asana.
  3. Click Add new Asana connection.
  4. Name the connection NTO Asana and click Create.
  5. Click Allow to grant MuleSoft Composer the permissions to access your name and email address; access your tasks, projects, and workspaces; and create and modify tasks, projects, and comments on your behalf. The NTO Asana connection is created, and the second step of the flow appears.
  6. Name the step Create Asana task and click Save.

Configure the second step in the first If branch to create tasks in Asana.

  1. Click in the Action field and select Create Task.
  2. Click in the Workspace Id field and select NTO Customer Service.
  3. Click in the Project Id field and select Engineering Triage.
  4. Map the following fields of the second step to their corresponding fields from step 1 of the flow.
    • Task Name: Subject from step 1
    • Task Description: Description from step 1

Create the second If branch to evaluate whether a case is high priority.

  1. Click Add If to add the second If branch.
  2. Click Add Conditions. The All conditions must be met (AND) condition is selected by default.
  3. Select Priority as the field and Equals as the operator, enter High as the value, and then click Save. If this condition is met, the next step in the second If branch (create Asana task) is executed.

Create the third step of the flow within the second If branch to handle high-priority cases.

  1. Click the plus icon to add a step within the second If branch.
  2. Click Asana and then click NTO Asana.
  3. Name the step Create Asana task and click Save.

Configure the third step within the second If branch to handle high-priority cases.

  1. Click in the Action field and select Create Task.
  2. Click in the Workspace Id field and select NTO Customer Service.
  3. Click in the Project Id field and select Cross-Functional Support.
  4. Map the following fields of the third step to their corresponding fields from step 1 of the flow.
    • Task Name: Subject from step 1
    • Task Description: Description from step 1

Create the Else branch to handle all remaining cases.

  1. Click Add Else.

Create the fourth step within the Else branch to handle all remaining cases.

  1. Click the plus icon to add a step within the Else branch.
  2. Click Asana and then click NTO Asana.
  3. Name the step Create Asana task and click Save.

Configure the fourth step in the Else branch to handle all remaining cases.

  1. Click in the Action field and select Create Task.
  2. Click in the Workspace Id field and select NTO Customer Service.
  3. Click in the Project Id field and select Customer Support.
  4. Map the following fields of the fourth step to their corresponding fields from step 1 of the flow.
    • Task Name: Subject from step 1
    • Task Description: Description from step 1
  5. Save the flow. Your entire flow should look like this.

Step 1 of flow showing new or updated NTO case as the trigger.

First If branch of flow showing conditions to determine if case is high priority and requires engineering assistance.

Step 2 of flow within first If branch showing task with Task Name and Task Description fields created in Asana.

Rest of step 2 of flow within first If branch showing fields such as Assignee Id and Assignee Status created in Asana.

Second If branch of flow showing condition to determine if case is high priority.

Step 3 of flow within second If branch showing task with Task Name and Task Description fields created in Asana.

Rest of step 3 of flow within second If branch showing fields such as Assignee Id and Assignee Status created in Asana.

Step 4 of flow within Else branch showing task with Task Name field created in Asana.

Rest of step 4 of flow within Else branch showing fields such as Assignee Id and Assignee Status created in Asana.

Next, you learn how to test your flow. 

Test a Flow

After you’ve designed your flow, you need to test it from end to end to ensure it syncs data as expected. In general, you have up to 10 minutes to complete a test. When the test completes or 10 minutes have passed, the test stops. As a best practice, you should get all required applications and data ready for the test before starting it.  

In this use case, when a customer service case is created or updated in the NTO org, it triggers the flow. So be prepared to enter a test case in the NTO org’s Service Cloud. 

If the case is high priority and requires engineering assistance, a task is created in the NTO Customer Service workspace’s Engineering Triage project in Asana. So get ready to verify that the task shows up as expected. 

If the case is high priority and doesn't require engineering assistance, a task is created in the NTO Customer Service workspace's Cross-Functional Support project in Asana. So get ready to verify that the task shows up as expected. 

For all other cases, a task is created in the NTO Customer Service workspace's Customer Support project in Asana. So be ready to verify that the task shows up as expected. 

Follow these steps to test a flow.

  1. In the Sync NTO Org Cases with Asana Tasks flow, click Test. The flow goes into a read-only mode.
    Note: While the test is running, if for some reason you want to stop it, click Stop Test
  2. Log in to the NTO org’s Service Cloud, navigate to the Cases tab, and click New.
  3. Configure the new case with the following values, and then click Save.
    • Case Reason: Equipment Design
    • Status: New
    • Priority: High
    • Case Origin: Phone
    • Requires Engineering Assistance: selected
    • Subject: Design issue with generator
    • Description: Complex design makes it difficult to assemble generator components correctly.
  4. Go back to your flow and wait for the test to complete. If step 1 and step 2 in the first If branch of the flow show a green check mark, this indicates the relevant steps of the flow for this case ran successfully. Take a look at the Test Output section and see the record values you entered for the test.
    Tested flow showing a green check mark on step 1.Tested flow showing first If branch conditions to determine if case is high priority and requires engineering assistance.Tested flow showing a green check mark on step 2 with Task Name and Task Description fields in first If branch.Tested flow showing the rest of step 2 with fields such as Assignee Id and Assignee Status in first If branch.
  5. Click the Engineering Triage project in Asana. The task Design issue with generator should appear.
  6. Click Design issue with generator. The Asana task fields should contain values from the corresponding NTO org case.
    Engineering Triage project in Asana showing task corresponding to NTO org case.
  7. Click Test on the flow again.
  8. Go back to the previous case in the NTO org’s Service Cloud, deselect the Requires Engineering Assistance checkbox, and click Save.
  9. Return to your flow and wait for the test to complete. If step 1 and step 3 in the second If branch of the flow show a green check mark, this indicates the relevant steps of the flow for this case ran successfully. Take a look at the Test Output section and see the record values you entered for the test.
    Tested flow showing a green check mark on step 1.Tested flow showing a green check mark on step 3 in second If branch.Tested flow showing the rest of step 3 with fields such as Assignee Id and Assignee Status in second If branch.
  10. Click the Cross-Functional Support project in Asana. The task Design issue with generator should appear.
  11. Click Design issue with generator. The Asana task fields should contain values from the corresponding NTO org case.
    Cross-Functional Support project in Asana showing task corresponding to NTO org case.
  12. Click Test on the flow again.
  13. Go back to the previous case in the NTO org’s Service Cloud, select Medium in the Priority field, and click Save.
  14. Return to your flow and wait for the test to complete. If step 1 and step 4 in the Else branch of the flow show a green check mark, this indicates the relevant steps of the flow for this case ran successfully. Take a look at the Test Output section and see the record values you entered for the test.
  15. Tested flow showing a green check mark on step 1.

    Tested flow showing a green check mark on step 4 with Task Name field in Else branch.

    Tested flow showing the rest of step 4 with fields such as Assignee Id and Assignee Status in Else branch.Click the Customer Support project in Asana. The task Design issue with generator should appear.

  16. Click Design issue with generator. The Asana task fields should contain values from the corresponding NTO org case.
    Customer Support project in Asana showing task corresponding to NTO org case.

  17. Repeat steps 1 through 16 to test another NTO org case of your choice. Your flow should work as expected.

Good job! In the next unit, you learn how to activate, monitor, and troubleshoot your flow in the production environment.

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities