2 Ways To Split A Workflow And Handle Conditional Logic
This guide provides different methods to manage conditional logic in MESA, enabling you to create more dynamic and responsive workflows. Learn how to split workflows based on specific criteria and implement conditional actions to streamline your processes. Enhance your automation capabilities and tailor your workflows to meet your unique business needs with these versatile approaches.
Topics:
Watch the demo
Splitting a workflow: Simple version
Let’s say that you want one thing to happen under one condition and another thing to happen under another condition. We don’t currently have standard if/else type blocks, but it’s usually pretty easy to workaround that with a little bit of custom code.
This one works by hitting Edit Code on the Filter by MESA step and adding this code to the else condition,, where the string shopify_2 is the key of the workflow step after the else condition:
Mesa.output.send('shopify_2', payload);
Splitting a workflow: Using a sub-workflow
This one can be useful for longer or more complicated workflows where you want to fire off a separate sub-workflow in the else condition.
This one works by hitting Edit Code on the Filter by MESA step and adding some this code to the else condition, where the key you’re passing in is the key of the subworkflow:
Mesa.automation.send('splitting-a-workflow---advanced-version---subworkflow', context.steps);
And here is the sub-workflow being called:
Questions about this workflow demo? Contact:
Kalen Jordan
MESA Service Partner