Waiting for a workflow state in interactive applications

See this discussion.