Workspace files
Sometimes a scenario or a per-field Python generator needs reference data — a CSV of real product SKUs, a JSON file mapping country codes to currencies, an Excel sheet of postcode-to-region. Workspace files are how you upload that data and reach it from your scripts.
Upload
Two options:
- UI: Open any chat or scenario, click the paperclip → Upload to workspace. Drag a file (CSV, JSON, YAML, XLSX, TXT, up to 50 MB on the hosted plan).
- API:
POST /workspace/files(multipart). See REST API.
Files are project-scoped. Listing them:
for f in dm.workspace_files.list(): print(f.name, f.size, f.uploaded_at)Read inside a scenario
with dm.workspace_file("currency_rates.csv").open("r") as f: rates = {row["code"]: float(row["rate"]) for row in csv.DictReader(f)}For JSON:
data = dm.workspace_file("postcodes.json").read_json()For Excel:
df = dm.workspace_file("regions.xlsx").read_dataframe(sheet="DACH")Read from a Python field generator
The same dm.workspace_file(...) API works inside a per-field
Python generator, with the same caveats (2-second
execution limit, no third-party packages).
Write from a scenario
Scenarios can also produce files — reports, logs, exported datasets — and surface them in the chat assets panel:
report = generate_report(...)dm.workspace_file("regression_report.csv").write_text(report)Files written from a scenario appear in the chat or scenario run’s Assets view, are
downloadable, and survive the run (unlike /workspace/ ephemeral files).
Updating a file
Re-uploading with the same name replaces the file. Or:
dm.workspace_file("currency_rates.csv").write_text(new_csv_content)Sharing across scenarios
Workspace files are visible to every scenario in the project. There’s no per-scenario isolation — be deliberate about names so two scenarios don’t fight over the same file.
For namespacing, use folders: upload as lookups/postcodes.json rather than just
postcodes.json.
Limits
| Plan | Max file size | Total storage | Files per project |
|---|---|---|---|
| Free | 10 MB | 100 MB | 25 |
| Pro | 50 MB | 5 GB | 1,000 |
| Enterprise | 500 MB | per contract | unlimited |
See Reference → Limits for the rest.
Deleting
dm.workspace_file("currency_rates.csv").delete()Or Settings → Workspace files → ⋯ → Delete in the UI. There’s no soft delete — deletion is immediate. If a scenario references a deleted file, it fails at runtime.