# logic.match

Sends the payload down the pin of the case it matches

# logic.match

```
logic.match --from EXPR [--case TEXT…] [--default TEXT]
```

Sends the payload down the pin of the case it matches. Evaluates `--from` (JavaScript over `input`) to a string and sends the payload, unchanged, down the pin of the matching `--case` (repeat it, one value each), or down the `--default` pin (`default` unless named) when nothing matches. Each case is an output pin you wire in graph mode (`[b]:create -> [c]`); the pins not taken are skipped, with every node only they feed. For a yes/no decision use [`logic.if`](/nodes/logic/logic.if.md).

## Flags

- `--from` (required): The value matched: JavaScript over `input` (and `$trigger`, `$nodes`), read as a string.
- `--case`: One case value, repeated (`--case created --case updated`); each becomes an output pin.
- `--default`: The pin taken when no case matches; `default` unless named.

## Examples

### Route by event type

```
| logic.match --from "$trigger.body.type" --case created --case updated --case deleted --default other
```

Pins: `created`, `updated`, `deleted`, `other`. Wire each: `[b]:created -> [c]`.
