You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the Router cannot determine an appropriate route for the given context, it will route to the **error path** instead of arbitrarily selecting a route. This happens when:
107
+
108
+
- The context doesn't clearly match any of the defined route descriptions
109
+
- The AI determines that none of the available routes are appropriate
110
+
105
111
## Best Practices
106
112
107
113
-**Write clear route descriptions**: Each route description should clearly explain when that route should be selected. Be specific about the criteria.
108
114
-**Make routes mutually exclusive**: When possible, ensure route descriptions don't overlap to prevent ambiguous routing decisions.
109
-
-**Include an error/fallback route**: Add a catch-all route for unexpected inputs that don't match other routes.
115
+
-**Connect an error path**: Handle cases where no route matches by connecting an error handler for graceful fallback behavior.
110
116
-**Use descriptive route titles**: Route titles appear in the workflow canvas, so make them meaningful for readability.
111
117
-**Test with diverse inputs**: Ensure the Router handles various input types, edge cases, and unexpected content.
112
118
-**Monitor routing performance**: Review routing decisions regularly and refine route descriptions based on actual usage patterns.
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/condition-input/condition-input.tsx
+9-4Lines changed: 9 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -654,17 +654,20 @@ export function ConditionInput({
return`You are an intelligent routing agent. Your task is to analyze the provided context and select the most appropriate route from the available options.
118
+
return`You are a DETERMINISTIC routing agent. You MUST select exactly ONE option.
119
119
120
120
Available Routes:
121
121
${routesInfo}
122
122
123
-
Context to analyze:
123
+
Context to route:
124
124
${context}
125
125
126
-
Instructions:
127
-
1. Carefully analyze the context against each route's description
128
-
2. Select the route that best matches the context's intent and requirements
129
-
3. Consider the semantic meaning, not just keyword matching
130
-
4. If multiple routes could match, choose the most specific one
126
+
ROUTING RULES:
127
+
1. ALWAYS prefer selecting a route over NO_MATCH
128
+
2. Pick the route whose description BEST matches the context, even if it's not a perfect match
129
+
3. If the context is even partially related to a route's description, select that route
130
+
4. ONLY output NO_MATCH if the context is completely unrelated to ALL route descriptions
131
131
132
-
Response Format:
133
-
Return ONLY the route ID as a single string, no punctuation, no explanation.
134
-
Example: "route-abc123"
132
+
OUTPUT FORMAT:
133
+
- Output EXACTLY one route ID (copied exactly as shown above) OR "NO_MATCH"
134
+
- No explanation, no punctuation, no additional text
135
+
- Just the route ID or NO_MATCH
135
136
136
-
Remember: Your response must be ONLY the route ID - no additional text, formatting, or explanation.`
0 commit comments