Skip to main content

Decision plugin reference

A decision plugin asks a model a constrained question about a message and writes the answer to a metadata key; the payload is not changed. All six are in module decision, which depends on llm-call.

Options every decision plugin accepts

  • Default node timeout: timeout plus 5 seconds.
  • Errors: Decision model failed: <cause>; The model gave no usable answer to '<question>'; The state is <n> characters, over maxStateChars <max> (onOverflow is fail). A failed decision fails the message; use the node’s engine policy to retry or route it (see Node options).

Window options (ANOMALY, DEDUPE)

Shared windows are kept in memory, at most 1000 at a time (least recently used dropped first).

CLASSIFY

Picks one label.
  • Output ports: default; with routeByLabel, one port per label plus uncertain.
  • Result (into default classification): {choice, probability, probabilities, label, uncertain}.

GATE

Asks a yes/no question.
  • Output ports: pass, reject.
  • Result (into default gate): {probability, passed}.

SCORE

Rates the message on an ordered scale.
  • Output ports: default without threshold; high, low with it.
  • Result (into default score): {score, level}; score runs from 0 to levels-1, probability weighted, and level is the nearest level.
  • Errors: levels needs 2 to 26 entries.

ASK

Asks up to 64 named questions in one model call.
  • Output port: default.
  • Result (into default answers): one entry per question name, shaped like the CLASSIFY, GATE and SCORE answers. Route on it with BRANCH.
  • Errors: At most 64 questions; Question '<name>' must be a map; Question '<name>' needs two or more criteria; Question '<name>' needs two or more levels; Question '<name>' has unknown type '<type>' (choice, yesno or score).

ANOMALY

Judges whether a message is unusual compared with the last window messages. Window options apply.
  • Output ports: normal, anomalous.
  • Result (into default anomaly): {probability, warmup}.
  • Errors: window must be 1 or more and minHistory 0 or more.

DEDUPE

Judges whether a message means the same as one of the last window unique messages. Window options apply.
  • Output ports: unique, duplicate.
  • Result (into default dedupe): {duplicate} for a unique message; {duplicate, duplicateOf, probability} for a repeat.
  • Errors: window must be 1 or more.