Skip to main content
In a browser automation, agent.download_files navigates a page, finds the download link, and captures the file. Downloaded files are stored in Skyvern’s cloud storage and returned as presigned URLs in the response. If you’re building workflows in the Cloud UI instead, use the File Download block. See Block Types and Configuration.

Download a file

browser = await skyvern.launch_cloud_browser()
page = await browser.get_working_page()

await page.goto("https://portal.example.com")
await page.agent.login(credential_type="skyvern", credential_id="cred_123")

result = await page.agent.download_files(
    "Download the Q4 2025 financial report",
    download_suffix=".pdf",
    download_timeout=30,
)

for file in result.downloaded_files or []:
    print(f"File: {file.filename}")
    print(f"URL: {file.url}")
    print(f"Checksum: {file.checksum}")

await browser.close()

Parameters

ParameterTypeRequiredDescription
promptstr / stringYesDescribe what to download. The agent navigates the page to find and click the download link.
urlstr / stringNoURL to navigate to before downloading. Defaults to the current page URL.
download_suffixstr / stringNoFilename hint prepended to the saved file (e.g., "invoice"invoice.pdf). Not a validator; mismatched extensions don’t fail the run. Omit this to get a system-generated filename like download-<timestamp>-<random>.pdf.
download_timeoutfloat / numberNoSoft hint (seconds) for how long to wait for a download to start. Not a hard cap; the overall timeout below governs failure.
max_steps_per_runint / numberNoCap AI steps for the download navigation.
timeoutfloat / numberNoTotal timeout in seconds (default: 1800).

Response

agent.download_files returns a WorkflowRunResponse. The downloaded files are in the downloaded_files field.

Response fields

Most-used fields:
FieldTypeDescription
run_idstrRun identifier (prefix: wr_)
statusstrcompleted, failed, terminated, timed_out, or canceled
downloaded_fileslist[FileInfo]Files captured during the run
outputdict | NoneAny extracted data (may be None even on completed)
app_urlstrLink to view this run in the Cloud UI
recording_urlstr | NoneVideo recording of the download session
failure_reasonstr | NoneError description if the download failed
step_countintNumber of AI steps taken
See the WorkflowRunResponse reference for the full field list.

FileInfo fields

Each file in downloaded_files has:
FieldTypeDescription
urlstrPresigned URL to download the file. Valid for a limited time.
filenamestr | NoneSaved filename. Reflects download_suffix if you set one, otherwise system-generated.
checksumstr | NoneSHA-256 checksum for integrity verification
modified_atdatetime | NoneLast-modified timestamp if the source provides one

Where files are stored

Files are stored in Skyvern’s managed cloud storage (S3). You access them through the presigned URLs returned in downloaded_files. Files are not saved to your local machine automatically. To save a file locally:
import requests

for file in result.downloaded_files or []:
    response = requests.get(file.url)
    with open(file.filename or "download.pdf", "wb") as f:
        f.write(response.content)
    print(f"Saved {file.filename}")

Tips

Set download_suffix to get a predictable filename (e.g., "invoice-q4"invoice-q4.pdf). Without it, files are saved with a system-generated name like download-<timestamp>-<random>.pdf. It does not validate or filter by extension. Raise the overall timeout for large files. download_timeout is a soft hint; timeout is what actually fails the run. Verify with checksums. The checksum field contains a SHA-256 hash. Compare it against expected values to verify file integrity. Login first. Most download portals require authentication. Call agent.login before agent.download_files - the agent reuses the authenticated session.

File operations in workflows

If you build workflows in the Cloud UI, file operations use dedicated blocks instead of agent.download_files:
BlockPurpose
File DownloadDownload files during workflow execution
File ParserParse PDFs, CSVs, and Excel files
Download to S3Save files from URLs to Skyvern’s S3
Upload to S3Upload workflow files to S3
File UploadUpload to your own S3 or Azure Blob Storage
Files downloaded during a workflow accumulate in a temporary directory and can be passed between blocks using workflow parameters. See Workflow Blocks Reference for block configuration details.

Full reference