Import File
An Import File node downloads a file from a URL and saves it on your site. Use it to download a partner's daily price list from their API, a report from a vendor portal, or a file whose URL an external system sends to a Webhook trigger, without a script or a Remote Server connection to that system.
Import File accepts file items or data items and imports one file for each item it receives, so a Webhook trigger that delivers 20 orders as data items can import 20 files when the URL is built from each item.
Settings
The URL is the address to download from, and it accepts a TransformScript template, so https://api.example.com/orders/{{ payload.order_id }}.pdf imports a different file for each item. The request method is GET by default, and POST is available when the endpoint needs a request body. Request headers take static names with templated values, which is how an API token or a date is sent, and the request content for a POST is a template as well.
Destination Filename Path is the full path of the file to save, including its filename, for example /imports/{{ payload.order_id }}.pdf. When it is empty, the file is named after the last segment of the URL. The path accepts the same tokens and templates as every destination.
What the Next Node Receives
Import File passes on one file item for each file it saved, so the imported file can be converted, decrypted, or moved by the nodes that follow.
Errors
A request that fails, or that returns an error status, fails that item. Error Handling rules on the node determine what happens to a failed item.