Benefit of wrapping my workflow in a State Machine?

Hi all, I have a flowchart with various sequences that’s working well. Is there any benefit to wrapping that in a state machine? I see this idea recommended a few places, but I’m not sure why. Thanks!

1 Like

Hi @steve3886

the most important aspect of state machines is that you can manage the complexity of transitions inside each one of them, so instead of having multiple if conditions to go from a sequence to another you can simply place your conditions inside a state machine.

But to use them effectively you need to optimize your process so it can operate on a few number of blocks where each block transition to one another based on conditions or exceptions much like the REFramework.

So if you have a linear flowchart you want to stick with the sequence per task scheme, otherwise if your process obey the above points you can transform it into a state machine one.

Regards,
Reda

4 Likes

A state machine is a type of automation that uses a finite number of states in its execution. It can go into a state when it is triggered by an activity, and it exits that state when another activity is triggered.
it is better for exception handle and for debugging and to make the workflow more easily to understand
please you may check this reference

https://studio.uipath.com/docs/state-machines

1 Like

This is just my opinion, but you can do everything you want with a Flowchart that you can do with a state machine… (framework models/templates, project organization, transition logic, error handling logic…) - and there is a learning curve with state machines, whereas in a Flowchart, you just read Decisions and Switches to navigate its logical direction.

But, I think the benefit with state machine is that it’s easier to provide “less clutter” with all those things and to provide a “shell” to place process components/workflows into in order to mitigate project deployment time.

The standard is to use a state machine for your framework model, and the “Reframework” is a feature of Studio where you can create a project starting from that model. So, it’s worth understanding and using and will help with standardization while creating projects within company infrastructures.

Thanks.

6 Likes

Thanks Clayton to you and the other robot masters here! I don’t see a clear need for an SM in my simple workflow. Yet anyway.

Here is an example of Hailstone Sequence using the State Machines in UIPath.

HailstoneDemo.xaml (17.1 KB)