Skip to main content
Files downloaded during a workflow session are stored in the cloud. Use download session files to retrieve downloaded files.

Step-by-step guide

Here’s an example workflow we have created to walk through how file downloads are handled.
const client = new SimplexClient({ apiKey });

// Create a workflow session
const workflow = await client.createWorkflowSession({
    name: 'download-files-example',
    url: 'https://www.simplex.sh/download-example.html',
    proxies: false
});

console.log('Session created:', workflow.sessionId);
console.log('Livestream URL:', workflow.livestreamUrl);

// Run agentic task to download files
await workflow.agentic('click download logo from select action');
console.log('File download task completed');

await workflow.close()

Download all files from a workflow session

const zipBuffer = await client.downloadSessionFiles(workflow.sessionId);
const zipPath = path.resolve(__dirname, `${workflow.sessionId}_files.zip`);
fs.writeFileSync(zipPath, zipBuffer);
console.log(`Zip file saved to: ${zipPath}`);

Download a specific file

Use the session store to see all downloaded files. Then download a single file by filename and session id.
{
  "succeeded": true,
  "session_store": [
    {
      "filename": "example_session_replay.json",
      "download_url": "https://www.simplex.sh/example_session_replay.json",
      "local_file_path": "/home/chrome_user/Downloads/example_session_replay.json",
      "file_size": 11039852,
      "download_timestamp": "2025-09-29T18:45:48.689433+00:00",
      "session_id": "6115b97b-63e0-48fe-8c2e-41ded0666520"
    }
  ]
}
// Get session store
const sessionStore = await client.getSessionStore(workflow.sessionId);

// Download the first file for example
const firstFile = sessionStore.session_store[0];
const fileBuffer = await client.downloadSessionFiles(workflow.sessionId, firstFile.filename);
const filePath = path.resolve(__dirname, firstFile.filename);
fs.writeFileSync(filePath, fileBuffer);
console.log(`File saved to: ${filePath}`);