Skip to content

ai.classify

Operation: ai.classify
Category: ai
Tags: text, classification

Classify text into one of a set of labels using an AI provider

Type: AI Provider (routed via provider registry)
Timeout: 300s
Retries: 3 (ExponentialWithJitter)

NameTypeRequiredDefaultDescription
textStringYesText to classify
NameTypeDescription
labelStringSelected label
confidenceStringConfidence level (high/low)
labelsArray<String>All available labels
raw_responseStringRaw provider response
{
"labels": [
"positive",
"negative",
"neutral"
]
}
import { WorkflowBuilder } from "@fabric-platform/sdk";
const workflow = new WorkflowBuilder("my-workflow")
.node("ai-classify", "ai_invoke", (n) =>
n.config({
operation: "ai.classify",
// ... node-specific config
})
)
.build();
{
"key": "classify-sentiment",
"operation": "ai.classify",
"config": {
"labels": ["positive", "negative", "neutral"]
},
"inputs": [{ "name": "text", "path": "$context.review_text" }],
"outputs": [{ "name": "label", "path": "$context.sentiment" }]
}

Cause: The AI response did not match any of the configured labels

Fix: The raw response is returned as the label with confidence ‘low’. Add more descriptive labels or use a prompt_template for better accuracy