or download this
my $workflow = Workflow::Generator->new(type => "myworkflow");
$state = $workflow->add_state(name => "INITIAL");
...
$state = $workflow->add_state(name => "uploaded", autorun => "yes")
+;
$state->add_action(name => "verify_file", resulting_state => "annot
+ate");
$condition = $state->add_condition(test => \&check_file);