Sequential versus State workflows
Windows Workflow Foundation offers two basic types for workflow, the sequential workflow and the state workflow. So when you start building a new workflow which is right one for you? Well it depends! You knew I was going to say that didn't you?
The State Workflow is the more fluid of the two. Basically the workflow is in a given state and waiting for events to move it into another state. This new target state can be every other state in the workflow. Normally this happens because an event is raised and the current state, or one of its parents knows how to handle the event and does so to trigger a state change. The workflow itself actually has another way, the SetStateQueue queue with a SetStateEventArgs argument to indicate the target state, which can be used to activate any other state, even if there is no event that has the new state as target. This makes state workflows very much like real live. After all how often are we not faced with issues that are not supposed to happen in the normal flow of things?
The Sequential Workflow on the other hand is much more rigid. Sure it can contain loops and branches with conditions but basically the path through the workflow is deterministic. So this is much more in line with automated processes or very rigid protocols that need to be applied. This doesn't mean that things cannot go wrong or if that happens we cannot cater for it but there is a clear distinction between the normal execution path and any exceptional deviations.
So what to choose?
Well the above basically gave it away already. If you have a rigid protocol, say for example you submit an expense report, you manager has to approve it, then if the amount is larger that a certain predetermined amount a senior manager has to approve it too and finally ou get the result (and with any luck some money) you are probably best of with a sequential workflow.
If on the other hand the same process is modeled more in terms of you submit it, your manager reviews it and might ask for clarification on some items. When done it goes to his supervisor, who in turn can send it back to you for more clarifications etc. In a case like this a state workflow seems more appropriate as the state of the expense report moves all over the place from submitted, to waiting for approval to waiting for clarification and back to waiting for approval.