You have to love the StateMachineWorkflowInstance object when working with state machine workflows. MS has done a pretty good job by making sure basic information is in there. For instance, need to know what states can be transitioned to from your current state? Need to know the current state's name? Or better yet, what is the state history of the workflow instance? You used to have to write a couple of lines of code to get it, however now it is right at your fingertips.
It's the "StateHistory" property, but there are a couple of rules at this time to make sure it works for you!
First thing is to realize that when using a config file to wire up services to the runtime that the connectstring, within the section, that connects the persistence service will not work the same with this property. Why? I am not sure, however it will probably be fixed later. What needs to be done here is to make sure the tracking server designates it's own connectionstr ing. Moustafa gives an example here. Once that is done, it will work!