File Functions

Functions for working with files over HTTP.

FunctionDescriptionInput → Output
DownloadFetch a text resource over HTTP/HTTPSurl, headers → file, contentType, statusCode

Download

Fetch a remote resource and return its body as text. The block is intended for text payloads — JSON, plain text, webhook content, XML.

InputRequiredDescription
urlyesFull http:// or https:// URL
headersnoJSON object of request headers
OutputTypeDescription
filestringResponse body decoded as UTF-8
contentTypestringContent-Type header from the server
statusCodenumberHTTP status code

Safety limits

To keep one flow from taking down the worker, the action enforces hard caps:

LimitValueWhat happens when exceeded
Response size10 MiBBlock fails with Response too large …
Total time30 secondsBlock fails with Download timed out after 30000 ms
Target hostprivate/reserved IPs blockedBlock fails with … not allowed

The size cap applies in two ways:

  • If the server sends a Content-Length header bigger than 10 MiB, the request is rejected immediately (no body is read).
  • Otherwise the body is read progressively; the read is cancelled as soon as the running total crosses the cap.

The host filter rejects any URL whose hostname resolves to a private, link-local, loopback, CGNAT/Tailscale, or cloud-metadata address. This prevents flows from probing internal infrastructure (SSRF).

Limitations

  • Text only. Binary files (images, PDFs, archives) come back as garbled UTF-8 and should not be used. A binary-safe upload action is on the roadmap (Upload, currently stubbed).
  • No retry. A transient 5xx or a timeout returns ERROR; chain the block with Branch and Retry After if your flow needs retries.

Example

Fetch a JSON webhook payload:

InputValue
urlhttps://api.example.com/webhook/abc123
headers{ "Authorization": "Bearer …" }

Outputs:

  • file → {"event":"...","data":{...}}
  • contentType → application/json
  • statusCode → 200

Use JSON → Parse on file to extract fields.