align_bpmn_elements
Aligns or distributes selected BPMN elements along an axis with optional pixel gaps to fix uneven diagram layouts.
Instructions
Align or distribute selected elements. Supports two operations: (1) align — align elements along an axis (left, center, right, top, middle, bottom), requires at least 2 elements. Use compact=true to also redistribute with ~50px gaps. (2) distribute — evenly distribute elements horizontally or vertically using edge-to-edge spacing, requires at least 3 elements. Use gap for exact pixel spacing (recommended: 50). ⚠️ Warning: alignment: middle on a process with parallel branches collapses all branches onto a single Y row, causing horizontal overlaps. Use layout_bpmn_diagram instead to re-arrange the full diagram while preserving branch separation. If you must use alignment: middle, pass compact: true to detect and spread overlapping elements on the X axis afterwards.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gap | No | Fixed edge-to-edge gap in pixels between elements (for distribute operation). Standard BPMN spacing is ~50px. When omitted, elements are evenly distributed within their current span. | |
| compact | No | When true (align operation), also redistributes elements along the perpendicular axis with ~50px edge-to-edge gaps. | |
| alignment | No | The alignment direction (for align operation) | |
| diagramId | Yes | The diagram ID | |
| elementIds | Yes | Array of element IDs to align or distribute | |
| orientation | No | Distribution direction (for distribute operation) |