Error uploading file using Workflows: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined

This same exact resource call works fine in a retool app, but not in a workflow.

For a simple example, I'm trying to send a file using Form Data with the following content for the file:

{{ { "name": `${uuid.v4()}.txt`, "type": "text/plain", "data": btoa("test content") } }}

And I keep getting stuck on this error, no matter what I've tried: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined

These are the in-app instructions for the "File" input in Worklow:

image

And totally different instructions for the "File" input in the main app:

image

Please help!

And it would be nice if Retool can make this consistent so I can use the same resources the same way between the main app and workflows.

@victoria I saw you've addressed similar issues before, perhaps you might have a suggestion here? Thanks.

Ok I found a workaround thanks to this post

It seems as though the "File" value in workflows is always treated as a string, whereas it expects an array, so it can't be done inline. When I created the necessary array in the previous workflow step and just used it directly, it worked.

2 Likes