Test a Workflow
The Mesa Test feature is a handy way to test a workflow. This feature lets you test using an example payload, recent payload, or custom payload. The payload refers to the data that is used to trigger the workflow.
1. Turn on Logging
Logging will help show information on how the workflow ran. If the workflow fails, logging will make sure to provide information on why the workflow failed.
You can turn on Logging under the Settings tab of the workflow.
2. Run the test
To test a workflow, you can click the Test button at the top of the workflow.
From here, you can select the payload you want to use to run a test.
Testing a workflow with a Custom Payload
The Custom Payload feature lets you paste in your own custom data to run a test. This is useful if you are well acquainted with your trigger's data structure and have access to payloads.
Testing a workflow with an Example Payload
The Example Payload will trigger the workflow using a pre-set payload. This payload is standard for each trigger. It does not contain live data. Because of this, the payload may result in an error depending on the Actions of the workflow.
For example, imagine that your workflow attempts to update a Shopify Order. If you test this workflow with an example Shopify Order Create payload, the test will fail because the example payload does not have a valid Shopify Order ID.
This Example Payload testing is useful if the workflow does not rely on data in the payload to complete. For instance, if you were trying to send a Slack message every time a product was created then this Example Payload testing would work well.
Testing a workflow with a Recent Payload
The Recent Payloads will trigger a workflow using data from the most recent instances that the workflow detected. The 10 most recent payloads will show in this testing feature. This method is useful if your workflow requires valid data to complete successfully.
For example, if you are trying to tag a customer if the order is placed from Canada, a recent payload will work well as a valid Customer ID is required to complete the workflow successfully.
If you choose to test using a Recent Payload, Mesa will run the workflow as if the workflow was enabled. Therefore, make sure you are comfortable with the output of the test.
For example, if you are tagging an order when it's total price over $100, make sure that you are comfortable with Mesa adding this tag when you test.
Note: You can manually edit any part of the payload before running the test. This is useful if you want to tweak certain properties of the payload.
3. View the Status of the Test
After you click Run Test, it is useful to click the View Task button. This will show you if the task ran successfully or if another failure occurred.
When viewing the task, you can see if the tasks were completed successfully or if they failed.
4. View the logs of any Failed tasks
If your task failed, it is recommended to view the logs of the failed task. This will give you some insight into what went wrong. To do so, click to View Logs on the failed task.