# Decision table (/docs/nodes/decision-table)



The **Decision table** node runs a table you maintain separately: rows are rules, columns are conditions and results. It is the right tool when the logic is a matrix that business people want to read and edit.

## When to use it [#when-to-use-it]

* Many combinations of inputs map to a result: pricing tiers, risk matrices, eligibility.
* The same logic backs several decisions, or changes more often than the flow.

## How it works [#how-it-works]

<Diagram node="decision-table" kind="anatomy" />

1. The published table (at the version pinned when the flow was published) is resolved.
2. Each table input is resolved: from the node's **input mapping**, else from the input's own derived expression, else from the payload field with the same name.
3. Rules are tested according to the **hit policy**: FIRST and PRIORITY stop at the first match; ALL and COLLECT gather every match.
4. If no rule matches, the table's default results are applied and the **No match** port is taken.

## Ports [#ports]

| Port       | Taken when                              |
| ---------- | --------------------------------------- |
| `Matched`  | At least one rule matched.              |
| `No match` | No rule matched; defaults were applied. |

## Configuration [#configuration]

| Field            | What it does                                                                                   |
| ---------------- | ---------------------------------------------------------------------------------------------- |
| Name             | Label shown on the canvas and in the trace.                                                    |
| Table            | The published table to run. Its version is pinned at publish.                                  |
| Input mapping    | Table input to expression. Leave an input unmapped to read the payload field of the same name. |
| Store results in | A variable name. Blank spreads each table output directly into the variables.                  |

## What it writes [#what-it-writes]

Each table output becomes a variable (`vars.risk_level`), or one object under the variable you named (`vars.risk.risk_level`). The trace lists every matched rule with the actual and expected values of each cell.

## In a real flow [#in-a-real-flow]

<Diagram node="decision-table" kind="example" />

A risk matrix scores the applicant. A match continues to the output; no match sends the case to manual review. The table is pinned: editing it later does not change a decision already published.

## When it fails [#when-it-fails]

* The table is not found at the pinned version: `TABLE_NOT_FOUND`.
* An input or a result expression cannot be evaluated: `EXPRESSION_FAILED`.
* No table selected, or one that does not exist, is an error in Checks.

## Good to know [#good-to-know]

* Not matching is a normal outcome, not an error. Connect **No match** on purpose.
* A final rule with no conditions acts as the "otherwise" row.

## Related [#related]

* [Decision tables guide](/docs/guides/decision-tables)
* [Switch](/docs/nodes/switch)
