CDN stores files the agent produces or receives and returns them as web File objects. An uploaded file is served at https://cdn.heylua.ai/<fileId> to anyone who has the id. Available in tools, jobs, webhooks, triggers, processors, and workflow code steps.
Verified against lua-cli 3.33.0.
Quick example
Upload returns an id; get returns aFile.
Methods
upload(file)
Uploads one file and returns its id.File
required
A web
File, for example new File([bytes], 'invoice.pdf', { type: 'application/pdf' }). Its name and type are stored with the file. The maximum size is 100 MB.image/*) are scaled so the longest edge is at most 2048 px, and a WebP variant is stored next to the original; the CDN serves the variant to clients whose Accept header includes image/webp and the original to everyone else. The width and height query parameters resize on fetch, and compressed=false returns the stored original.
Returns — the file id, for example abc123-def456-ghi789.
Example
Upload failed: <status>, or the server’s own message in lua test.
get(fileId)
Fetches a file by id.string
required
The id
upload returned.File whose name is the stored filename (the id when none was stored), type the served content type, and size the byte length. Read it with text(), arrayBuffer(), or stream(). The fetch sends no Accept header, so images come back in their stored format, not as WebP.
Example
File not found: <status>, for example File not found: 404.
Types
None are exported.File is the standard web File, a global in Node 20 and later.
See also
AI— pass file bytes asimageandfilepartsData— store file ids next to your own records- Device uploads — how devices put files on the CDN

