Salesforce Files Bulk Downloader is a Robot Framework and Python tool for downloading files from lists of Salesforce ContentDocumentId values. It is built for migrations, backups, and archives of any size.
Built with
- Robot Framework
- Python
- SeleniumLibrary
- Salesforce REST API
- Salesforce CLI
- Google Chrome
Salesforce stores a file, its versions, and its record associations in separate objects. Moving those files means preserving the relationships while dealing with API limits, expiring sessions, large binaries, and partial failures.
This tool separates metadata queries from binary downloads, validates each file, keeps batch output isolated, and records any failures. It can also create Data Loader-ready workbooks. The Introduction explains the Salesforce data model and migration workflow.
- Enterprise file migration projects
- Salesforce org consolidation
- Divestitures and acquisitions
- Backup and archival
- Migration validation and reconciliation
- Large-scale ContentDocument extraction
- Sandbox preparation
- Disaster recovery preparation
- Accepts 15- and 18-character
ContentDocumentIdvalues, canonicalizes them to 18 characters, and removes duplicates - Uses Salesforce CLI authentication without storing usernames or passwords
- Queries
ContentDocumentand all associatedContentDocumentLinkrecords in batches - Checks Salesforce daily API capacity before starting download work
- Downloads each physical file once into a ContentDocument-specific directory
- Isolates download and artifact directories for each batch and worker
- Checks completion, stability, and final size against Salesforce
ContentSize - Keeps downloaded files and migration-workbook rows consistent if a workbook update fails
- Automatically retries transient download failures and writes structured failure codes, messages, and attempt counts for unresolved IDs
- Writes a per-batch JSONL manifest for reconciliation and auditing
- Detects expired REST and browser sessions instead of reporting them as generic download failures
- Creates optional ContentVersion and ContentDocumentLink import workbooks
- Escapes formula-like ContentVersion titles before writing migration workbooks
- Supports headless Chrome and Pabot test-level parallel execution
- Validates Python and Robot code with Ruff, Robocop, and cross-platform CI
git clone https://github.com/b-vamsipunnam/salesforce-files-downloader-tool.git
cd salesforce-files-downloader-tool
python -m venv venv
python -m pip install -r requirements.txtComplete the Installation checks first, then follow Authentication to log in and create org_info.json:
robot --variable ORG_ALIAS:<org_alias> --output NONE --log NONE --report NONE src/robot/orchestrators/authenticate.robotAdd ContentDocumentId values to the first column of input/Inputfile_1.xlsx, then run the downloader:
robot --outputdir results src/robot/orchestrators/download.robotDownloaded files appear in downloads/, migration and failure workbooks in artifacts/, and Robot Framework reports in results/.
Salesforce REST APIs provide the metadata, and an authenticated Selenium browser downloads the binaries from Shepherd. Robot Framework handles the workflow and reporting, while Pabot can run isolated batches in parallel. See Architecture for details.
| Documentation | Description |
|---|---|
| Introduction | Salesforce Files concepts, enterprise migration challenges, and why this tool exists |
| Installation | Prerequisites and environment setup |
| Authentication | Salesforce CLI authentication and session handling |
| Configuration | Runtime variables, paths, timeouts, and execution settings |
| Usage | Sequential and parallel execution instructions |
| Examples | Common execution scenarios |
| Architecture | End-to-end system design and component responsibilities |
| Performance | Benchmark results, worker scaling, retries, and validation |
| Keyword Documentation | Robot Framework keywords grouped by responsibility |
| Troubleshooting | Common errors and recommended resolutions |
| FAQ | Frequently asked technical and usage questions |
| Limitations | Current constraints and unsupported scenarios |
| Roadmap | Planned improvements and future direction |
| Contributing | Development workflow and contribution guidelines |
salesforce-files-downloader-tool/
├── docs/
├── src/
│ └── robot/
│ ├── libraries/
│ ├── orchestrators/
│ └── resources/
├── input/
├── downloads/
├── artifacts/
├── results/
├── requirements.txt
├── LICENSE
├── README.md
├── CODE_OF_CONDUCT.md
└── SECURITY.md
docs/contains the project documentation and architecture diagram.src/robot/libraries/contains custom Python libraries used by Robot Framework.src/robot/orchestrators/defines executable download batches.src/robot/resources/contains configuration and reusable workflow keywords.input/contains Excel workbooks listing sourceContentDocumentIds.downloads/stores validated file binaries in isolated batch directories.artifacts/stores JSONL execution manifests, migration workbooks, and structured failed-ID workbooks.results/receives Robot Framework and Pabot execution reports.requirements.txtpins the Python dependencies used by the project.requirements-dev.txtpins the Ruff and Robocop versions used by contributors and CI.
Before opening an issue or pull request, read the Contributing guide, Code of Conduct, and Security Policy.
Licensed under the MIT License.