Automating workflows with APIs