Skip to content

Step: Classifier

  • Key: classifier
  • Category: Workflow Control
  • Description: Use a model to classify input into one configured branch.

Inputs

  • modelId (model select, required): Model used for classification.
  • prompt (long-text, required): Text or template describing what should be classified.
  • categories (array, required): Branch options. Each category should include a key, optional description, and the target step for that category.

Outputs

  • key (string): Selected category key.
  • reason (string): Short model-generated explanation.
  • targetStepId (string): Target step selected from the matched category. This is used by the Flow runtime for branching.

Branching

The classifier returns a targetStepId when the selected category is connected to a branch. The runtime follows that target step instead of the default next step.

Notes

  • Keep category keys short and stable, for example support, sales, or billing.
  • Use category descriptions to make the model's routing decision explicit.
  • Use reason in debug logs or final responses when you need to explain why a branch was selected.

Example

Classify an incoming peer message:

text
Prompt: Classify this request: { {message} }

Categories:
- support: user needs help with an existing issue
- sales: user is asking about pricing or purchasing
- billing: user has an invoice or payment question

Built with VitePress