diff --git a/apps/docs/content/docs/en/blocks/router.mdx b/apps/docs/content/docs/en/blocks/router.mdx index e0f916fc83..44bac918e7 100644 --- a/apps/docs/content/docs/en/blocks/router.mdx +++ b/apps/docs/content/docs/en/blocks/router.mdx @@ -6,12 +6,12 @@ import { Callout } from 'fumadocs-ui/components/callout' import { Tab, Tabs } from 'fumadocs-ui/components/tabs' import { Image } from '@/components/ui/image' -The Router block uses AI to intelligently route workflows based on content analysis. Unlike Condition blocks that use simple rules, Routers understand context and intent. +The Router block uses AI to intelligently route workflows based on content analysis. Unlike Condition blocks that use simple rules, Routers understand context and intent. Each route you define creates a separate output port, allowing you to connect different paths to different downstream blocks.
Router Block with Multiple Paths`**: Summary of the routing prompt -- **``**: Chosen destination block +- **``**: The context that was analyzed +- **``**: The ID of the selected route +- **``**: Details of the chosen destination block - **``**: Token usage statistics - **``**: Estimated routing cost - **``**: Model used for decision-making @@ -75,26 +78,36 @@ Your API key for the selected LLM provider. This is securely stored and used for ## Example Use Cases **Customer Support Triage** - Route tickets to specialized departments + ``` -Input (Ticket) → Router → Agent (Engineering) or Agent (Finance) +Input (Ticket) → Router + ├── [Sales Route] → Agent (Sales Team) + ├── [Technical Route] → Agent (Engineering) + └── [Billing Route] → Agent (Finance) ``` **Content Classification** - Classify and route user-generated content + ``` -Input (Feedback) → Router → Workflow (Product) or Workflow (Technical) +Input (Feedback) → Router + ├── [Product Feedback] → Workflow (Product Team) + └── [Bug Report] → Workflow (Technical Team) ``` **Lead Qualification** - Route leads based on qualification criteria + ``` -Input (Lead) → Router → Agent (Enterprise Sales) or Workflow (Self-serve) +Input (Lead) → Router + ├── [Enterprise] → Agent (Enterprise Sales) + └── [Self-serve] → Workflow (Automated Onboarding) ``` - ## Best Practices -- **Provide clear target descriptions**: Help the Router understand when to select each destination with specific, detailed descriptions -- **Use specific routing criteria**: Define clear conditions and examples for each path to improve accuracy -- **Implement fallback paths**: Connect a default destination for when no specific path is appropriate -- **Test with diverse inputs**: Ensure the Router handles various input types, edge cases, and unexpected content -- **Monitor routing performance**: Review routing decisions regularly and refine criteria based on actual usage patterns -- **Choose appropriate models**: Use models with strong reasoning capabilities for complex routing decisions +- **Write clear route descriptions**: Each route description should clearly explain when that route should be selected. Be specific about the criteria. +- **Make routes mutually exclusive**: When possible, ensure route descriptions don't overlap to prevent ambiguous routing decisions. +- **Include an error/fallback route**: Add a catch-all route for unexpected inputs that don't match other routes. +- **Use descriptive route titles**: Route titles appear in the workflow canvas, so make them meaningful for readability. +- **Test with diverse inputs**: Ensure the Router handles various input types, edge cases, and unexpected content. +- **Monitor routing performance**: Review routing decisions regularly and refine route descriptions based on actual usage patterns. +- **Choose appropriate models**: Use models with strong reasoning capabilities for complex routing decisions. diff --git a/apps/docs/public/static/blocks/router.png b/apps/docs/public/static/blocks/router.png index 30942f2988..c66f3039e7 100644 Binary files a/apps/docs/public/static/blocks/router.png and b/apps/docs/public/static/blocks/router.png differ