Export batch
export_batchExport multiple document objects in various formats and sizes in a single call, with dry-run validation and budget control.
Instructions
Run a bounded batch of typed export specs in one call (dry-run by default).
When to use: exporting many sizes/formats/objects in one call. For a single export use
export_document / export_object; for a standard icon set use create_icon_set.
Key params: specs is a typed list (each: format png/pdf/svg, optional width_px, optional
object_id for a single object). Bounded: at most a fixed number of specs per call and a
total-output byte budget (byte_budget, default: the per-document artifact budget).
dry_run=True (DEFAULT) validates and returns the plan + projected sizes + within_budget,
writing nothing; dry_run=False refuses cleanly if the projection exceeds the budget. out_dir
writes into a caller-chosen dir — relative anchors to the workspace ROOT,
sandbox-checked (out-of-workspace rejected "path rejected: outside workspace"); name_prefix
tags each file.
Return shape: BatchResult — item_count, per-item entries (each with a
workspace_relative_path on a real run), projected/actual total size, and within_budget.
Example: export_batch(doc_id, [{"format": "png", "width_px": 256}], dry_run=False)
Risk class: low (artifact-only export to a sandbox-checked dir; composes the engine).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| specs | Yes | ||
| doc_id | Yes | ||
| dry_run | No | ||
| out_dir | No | ||
| byte_budget | No | ||
| name_prefix | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | No | ||
| doc_id | Yes | ||
| dry_run | Yes | ||
| item_count | Yes | ||
| byte_budget | Yes | ||
| within_budget | Yes | ||
| actual_total_bytes | Yes | ||
| projected_total_bytes | Yes |