Durable Workflows (WDK)

Pattern

Routing Workflow Pattern

Demonstrates a routing workflow pattern using Workflow DevKit. Features query classification and conditional routing to specialized handlers based on type and complexity.

IntermediateNov 2025View the full pattern on desktop
Routing Workflow Pattern preview

Problems solved

  • Classify queries before routing inside Workflow DevKit
  • Send work to specialized handlers by type and complexity
  • Select models dynamically after classification
  • Persist routing workflow steps durably

Use cases

  • Customer service routing workflows
  • Query classification systems
  • Conditional handler selection
  • Workflow DevKit routing tutorials

AI SDK APIs

generateObjectgenerateText

Tags

aiworkflowroutingclassificationconditionalcustomer-serviceai-sdkworkflow-devkitquery-handling

Requirements

Node.js
24+
Memory
512MB
Other
  • OpenAI API key
  • Workflow DevKit setup

Environment variables

External services

openai

Ready to use?

View the full interactive pattern with live preview and copy the source code.

View the pattern on desktop

Related patterns