function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Brian NewboldBrian Newbold 

Visual Workflow / Flow processing - Sequential/Linear or not?

This might be a simple simple question but I haven't found a straight answer: 
Building flows with Visual Workflow, are the steps performed sequentially as shown on the flow in all cases?

For example, record A created -> record B created -> record A updated with new ID of record B.

In this example if there were any reason record B didn't get created you can't update record A.
Can I assume that record B gets created before the record A update fires? Or should I not assume things work as expected, and pad in wait states and error trapping on whether or not records get created?

And extra-points if any of you mega-brains answering want to throw in some DML and SOQL error trapping steps that would apply in heavy record create/update flows.

Thanks!!

Santosh Kumar Sriram_2310Santosh Kumar Sriram_2310
Hi Brian,
The flows are sequential/linear, as you can carry over values from one block to another.
For exception handling 
In the apex class do your validation/exception handling and when validation fails/exception is thrown then you assign the value llike "Invalid Email Address"/"Error message displaying the Exception" to Output variable using Apex callout.

In the flow, now do a decision whether the output variable equals to "Invalid Email Address"/"Error message displaying the Exception" or not. If yes then assign Yes path back to previous message and display the error message with variable. If no then assign the path to next screen.

Hope this helps!