add_edge
Connects two nodes in a draw.io diagram with an edge or arrow. Supports multiple edge styles and precise entry/exit points for clear, readable layouts.
Instructions
Add a connection (edge/arrow) between two nodes in a draw.io diagram.
LAYOUT TIPS for readable diagrams:
Use "curved" edgeStyle when multiple edges connect the same pair of nodes, combined with different exitPoint/entryPoint to separate them visually.
Use "orthogonal" for clean right-angle routing in architecture diagrams.
Use exitPoint/entryPoint to control WHERE on a node the edge connects (e.g. "left", "right", "topLeft25", "bottomRight75") — this prevents edges from stacking on top of each other.
For bidirectional flows, use two separate edges with offset connection points (e.g. edge A: exitPoint="rightTop25" → entryPoint="leftTop25", edge B: exitPoint="leftBottom75" → entryPoint="rightBottom75").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Custom ID for the edge | |
| label | No | Label for the edge | |
| style | No | Custom draw.io style string | |
| filePath | Yes | Path to the .drawio file | |
| sourceId | Yes | ID of the source node | |
| targetId | Yes | ID of the target node | |
| edgeStyle | No | Predefined edge style. Available: straight, orthogonal, orthogonalSharp, curved, entityRelation, elbowHorizontal, elbowVertical, isometric, arrow, openArrow, dashed, dotted, bidirectional, noArrow, orthogonalDashed, curvedDashed, orthogonalBidirectional, curvedBidirectional, orthogonalNoArrow | |
| exitPoint | No | Where the edge exits the source node. Available: top, bottom, left, right, topLeft, topRight, bottomLeft, bottomRight, topLeft25, topRight75, bottomLeft25, bottomRight75, leftTop25, leftBottom75, rightTop25, rightBottom75. Use offset variants (e.g. topLeft25, rightBottom75) when multiple edges share a node to avoid overlap. | |
| pageIndex | No | Page index (0-based, default: 0) | |
| entryPoint | No | Where the edge enters the target node. Available: top, bottom, left, right, topLeft, topRight, bottomLeft, bottomRight, topLeft25, topRight75, bottomLeft25, bottomRight75, leftTop25, leftBottom75, rightTop25, rightBottom75. Use offset variants to separate parallel edges. |