Download Methods
Click to Download
Download Metadata
Attach freeform JSON to a download when usingexpect_download. Values support the same {variable} substitution as other action fields:
downloads_with_metadata (see Callbacks). On interaction actions, only click_element / select_option with expect_download support this field; from a Python script, pass metadata= to ctx.save_download().
Save a File from a Python Script
When a script has already fetched or assembled the bytes — an API response, a CSV it built, pages it reassembled into a PDF — it can register the file directly instead of routing it back through the browser:expect_download
downloads. This replaces the older workaround of base64-ing bytes into a Blob,
injecting an <a download> anchor, and adding a second click_element node to
click it — which cost a screenshot, an axtree capture and a trajectory upload per
file.
See Python Script Action
for the full ctx reference.
Select to Download
Save Page as PDF
Capture current page or specific URL as PDF:Download a File for Upload
Usedownload_file when a later agentic_task needs to upload a file from a URL. The file stays on disk, its path is stored in a generated variable, and that path is passed to the agent as an allowed upload file.
download_url_as_pdf does not do this. It saves into the task downloads directory and does not expose the path to the agent.
The file is
/tmp/optexity_download_<random>.<ext>. It is not deleted when the node finishes. The extension comes from the URL path, Content-Disposition, or Content-Type, in that order.
output_variable_name to change the variable name. The index stays [0].
Multiple Downloads
Usefor_loop_node to download multiple files:
Upload Files
The file source must be exactly one offile_path or file_url. Setting both, or neither, is rejected by the schema.
Upload from a local path:
Download Storage
Downloaded files are stored in the task’s downloads directory:Waiting for Downloads
Optexity automatically waits for downloads whenexpect_download=true. The default wait is 200 seconds (DOWNLOAD_TIMEOUT_SECONDS). Override it per node with download_timeout_seconds for slow or large files:
end_sleep_time on the node for extra post-action delay after the download completes.
Failure on Missing Download
When a node expects a file but none is produced, the task fails rather than silently continuing. This applies to both download mechanisms:expect_download=true (click_element / select_option):
download_url_as_pdf: