Still trying to pull receipt images from my banks API into something but it seems Notion (and Google Sheets FYI) can only work with URLs which isn’t helpful in my case.
Hi @Tony_McHugh, the situation is pretty much the same with Notion I am afraid. Their API does not allow uploading files:
The same would be true for many other popular services (such as Airtable) I am afraid, so n8n can’t implement a direct upload functionality here either and you would need to first make your file available under a public URL (such as AWS S3 for example).
One service supporting file uploads would be Baserow, so perhaps this could be an alternative for you? n8n doesn’t have native support for their upload_file endpoint at the moment, but this could be achieved with the HTTP Request node.
The prerequisite for everything is, of course, that your n8n webhooks are publicly accessible.
It depends on the service.
If I interpret the API File object correctly, you need a “public” URL. Just means that a server must be able to call this URL. Primarily once via a GET method.
To not make the file available somewhere, you give the API a throwaway url “Wait webhook”. The service should call this URL directly (the wait node should already be waiting) and the workflow will continue: The file is read and returned as a response file.
Step-by-step:
Workflow start
Generate Wait URL
Request URL/API
Parallel: Wait node waits for response
Foreign API server calls wait node
The file is read
n8n responds with the file as HTTP response
It might be hard to execute the HTTP Request node PARALLEL to the Wait node. Possibly an additional wait node (timing) must be set. Depending on when the server sends its response. Either it tries to download the file when it is called (in which case the wait may not be running yet) or it downloads the file after the response. If you have bad luck it makes several GET requests.
A safer variant would be, simply create another workflow >> Webhook >> file read >> answer. You can also do this with parameters, if you don’t want to create a webhook for every file. Info: If the URL with parameters bothers you (the node UUID is used) you can copy the node and rewrite the ID to something readable in an editor. Works great. Or much simpler: use a query for path.