Learning Distributed Workflows