Windows Workflow offers two workflow execution styles out of the box: sequential and event-driven. A sequential workflow completes one activity and moves to the next, executing a sequence of consecutive steps. As an example, a sequential workflow could model the process of moving records from a website's compressed log file into a database table. Step 1 would download the compressed log file. Step 2 would decompress the log file. Step 3 would bulk insert records from the log file into a table, and step 4 would create summary statistics from the new records. Even though a sequential workflow can use branches, loops, and receive external events, it is mostly predictable and marches inevitably forward to completion.
Event-driven workflows, on the other hand, rely on external events to drive them to a finishing point. Event-driven workflows model a workflow as a state machine. A state machine consists of a set of states (including an initial state and a final...