How do we download/write an xml file to our local system when we call an API via an HTTP request in webmethod io integration?

The HTTP response will be in your ‘pipeline’, so you can map this response into any other connector/action - there’s no need to write a ‘local file’.

You also don’t need to use workflow to do this by the way.
The FlowService example I posted over here: (How to transform XML TO FLATFILE IN WEBMETHOD IO INTEGRATION? - Forum - webMethods - Software AG Tech Community & Forums) does exactly what you’re asking. donwloads an XML from a HTTP end point and converts this to a flat file. After you’ve got the CSV data, then you’ll probably want to send that somewhere else, e.g. Amazon S3 bucket, or SFTP for example.