Skip to main content
A decision plugin asks a model a constrained question about a message and records the answer in the message metadata. The answer is always in a known shape: a label from your list, a probability, or a score. You route on it with the plugin’s own ports or with a BRANCH node. All six need the optional decision module, which also brings in LLM_CALL. See Built-in plugins for how a build selects it. Use them to classify, to gate on a yes/no judgement, to rate on a scale, to ask several questions in one call, or to spot unusual and repeated messages.

Common options

Every decision plugin takes these options in addition to its own. The two backends: The decision is written to metadata[into]. The payload is not changed. A model failure, a reply that is not valid, or a label that is not among the options fails the message. Use the node’s engine policy (retry and error routing) to retry or send failures to a dead letter: see Failure handling. Describe each label, level and criterion explicitly. A small decision model depends on those descriptions. Default timeout: timeout plus 5 seconds, so 35 seconds with the default. CLASSIFY, GATE, SCORE and ASK handle up to 256 messages at once, with results emitted in order. ANOMALY and DEDUPE handle one at a time.

CLASSIFY

Picks one label for the message. into defaults to classification. The result is {"choice", "probability", "probabilities", "label", "uncertain"}: the chosen label, its probability, the probability of every label, and whether the answer counts as uncertain (a probability below minProbability). Output ports: default, or with routeByLabel one port named like each label plus uncertain. A message leaves on its label’s port, or on uncertain when it is uncertain. Label names therefore become port names.

GATE

Asks a yes/no question and routes on the answer. into defaults to gate. The result is {"probability", "passed"}. Output ports: pass when the probability of yes is at or above threshold, otherwise reject.

SCORE

Rates the message on an ordered scale. into defaults to score. The result is {"score", "level"}. The score runs from 0 to the number of levels minus one and is weighted by the model’s probabilities. level is the nearest named level. Output ports: default, or high and low when threshold is set (high at or above it).

ASK

Asks several questions about one message in a single model call. Each definition is {"type", "instructions", "criteria"}: into defaults to answers. The result is an object with one entry per question name. Output port: default. Route on the answers with a BRANCH node, for example on metadata['answers']['sentiment']['choice'].

ANOMALY

Judges whether each message is unusual compared with the recent ones. into defaults to anomaly. The result is {"probability", "warmup"}. Output ports: normal and anomalous. The first minHistory messages are always normal, with warmup true and probability 0.

DEDUPE

Judges whether a message means the same as a recent one. into defaults to dedupe. The result is {"duplicate": false} for a unique message, and {"duplicate": true, "duplicateOf": "<message id>", "probability": ...} for a repeat. Output ports: unique and duplicate. Only unique messages enter the window. The first message is always unique. For both ANOMALY and DEDUPE, the window belongs to one node in one execution and holds each message as text cut to 500 characters. It is kept in memory and starts empty in every execution. A workflow that is started again for every event therefore never builds history, and every message looks normal or unique. Use them in a long-running execution, for example one started by SCHEDULE_TRIGGER.

Limits and defaults