add_router
Branch a flow into multiple paths using probability or priority-based routing to control process splitting.
Instructions
Add a Router (Splitter) pattern that branches flow into multiple paths.
Args: name: Name for this router (e.g., "QualityCheck", "LoadBalancer") routes: List of route configurations: For probability: [{"name": "Accept", "prob": 0.9}, {"name": "Reject", "prob": 0.1}] For priority: [{"name": "Primary", "priority": 2}, {"name": "Backup", "priority": 1}] PRIORITY RULE: higher "priority" number fires first (same as add_transition). The route with the highest priority number is tried first; lower numbers are fallbacks. strategy: "probability" for random split, "priority" for ordered selection
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| routes | Yes | ||
| strategy | No | probability |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |