roam_process_batch_actions
Batch create, update, move, and delete Roam blocks in a single API call to reduce rate limits and improve efficiency. Use placeholders for nested block UIDs.
Instructions
RATE LIMIT EFFICIENT: This is the most API-efficient tool for multiple block operations. Combine all create/update/delete operations into a single call whenever possible. For intensive page updates or revisions, prefer this tool over multiple sequential calls.
Executes a sequence of low-level block actions (create, update, move, delete) in a single, non-transactional batch. Actions are executed in the provided order.
UID Placeholders for Nested Blocks: Use {{uid:name}} syntax for parent-child references within the same batch. The server generates proper random UIDs and returns a uid_map showing placeholder→UID mappings. Example: { uid: "{{uid:parent1}}", string: "Parent" } then { location: { "parent-uid": "{{uid:parent1}}" }, string: "Child" }. Response includes { success: true, uid_map: { "parent1": "Xk7mN2pQ9" } }.
For actions on existing blocks, a valid block UID is required. Note: Roam-flavored markdown, including block embedding with ((UID)) syntax, is supported within the string property for create-block and update-block actions. For actions on existing blocks or within a specific page context, it is often necessary to first obtain valid page or block UIDs. Tools like roam_fetch_page_by_title or other search tools can be used to retrieve these UIDs before executing batch actions. For simpler, sequential outlines, roam_create_outline is often more suitable.
IMPORTANT: call roam_get_guidelines for this graph once per session, and load the Roam Markdown Cheatsheet, before using this tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| graph | No | Target graph key from ROAM_GRAPHS config. Defaults to ROAM_DEFAULT_GRAPH. Only needed in multi-graph mode. | |
| actions | Yes | An array of action objects to execute in order. | |
| write_key | No | Write confirmation key. Required for write operations on non-default graphs when write_key is configured. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Present only when success is false. | |
| success | Yes | ||
| uid_map | No | Placeholder name → generated UID. Present only on success. | |
| actions_attempted | No | ||
| validation_passed | No |