> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nemu.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Node reference

> Every node type, what it reads, and how to configure it

Nodes come in four groups in the editor: triggers, checks, conditions and
actions. A workflow needs exactly one trigger and at least one model selection.

## Model trigger

Names the model that makes this workflow run. Exactly one per workflow.

| Field | Type   | Notes                              |
| ----- | ------ | ---------------------------------- |
| Model | string | A gateway name from your workspace |

The match is exact. A request for any other model leaves the workflow alone.

## Model selection

Terminal node. Names the model the request will actually run on.

| Field | Type   | Notes                             |
| ----- | ------ | --------------------------------- |
| Model | string | Must be enabled in this workspace |

The first branch that reaches one of these wins, and the walk stops there.

<Warning>
  The lookup is case sensitive on the provider segment. If your provider is
  named `OpenAI` rather than `openai`, selection fails and the request stays on
  its original model. Keep provider names lowercase.
</Warning>

## Metric check

The most useful node, and the only one that branches. It aggregates your own
recorded usage for a model over a window and compares it against a threshold.

| Field      | Type   | Notes                                     |
| ---------- | ------ | ----------------------------------------- |
| Conditions | list   | At least one. Every condition must pass   |
| Model      | string | Optional. Defaults to the inherited model |

Each condition is a metric, an operator and a threshold over a time window.

| Metric          | Meaning                |
| --------------- | ---------------------- |
| `requests`      | Number of requests     |
| `input_tokens`  | Prompt tokens          |
| `output_tokens` | Completion tokens      |
| `total_tokens`  | Both                   |
| `cost`          | Recorded cost          |
| `latency_avg`   | Average latency        |
| `latency_max`   | Slowest request        |
| `error_rate`    | Percentage of failures |
| `images`        | Images generated       |
| `audio_seconds` | Audio processed        |

Operators are less than, less or equal, equal, greater or equal, greater than.
Windows are 1 hour, 6 hours, 24 hours, 7 days or 30 days.

The node emits **success** when every condition passes and **failure**
otherwise, and you wire a different edge to each.

<Note>
  Wire both outputs. An edge leaving this node with no output assigned is never
  followed.
</Note>

## Quota check

Reads one of your quota rules and branches on whether it is exhausted.

| Field       | Type                 | Notes                     |
| ----------- | -------------------- | ------------------------- |
| Quota rule  | string               | One of your enabled rules |
| On exceeded | `fail` or `continue` | Default `fail`            |

The meaning inverts with that setting. With **fail**, the node continues only
while the quota still has room. With **continue**, it continues only once the
quota is exhausted, which is how you build the fallback branch.

## Quota rule event

Continues based on whether a named quota rule has reached its limit, using the
usage already gathered for this request.

| Field        | Type                 | Notes                     |
| ------------ | -------------------- | ------------------------- |
| Quota rule   | string               | One of your enabled rules |
| On triggered | `continue` or `fail` | Default `continue`        |

## Image detection

Continues based on whether the request carries an image.

| Field    | Type    | Notes                               |
| -------- | ------- | ----------------------------------- |
| Expected | boolean | Continue when presence matches this |

Detection recognises OpenAI style `image_url` content parts. Anthropic style
image blocks are not detected, so use this on the OpenAI endpoints.

## Time and date conditions

Continues based on when the request arrived.

| Field | Type                            | Notes                                            |
| ----- | ------------------------------- | ------------------------------------------------ |
| Type  | `time_between` or `day_of_week` |                                                  |
| Value | object or list                  | `{start, end}` as `HH:MM`, or day numbers 0 to 6 |

Times are evaluated in the gateway's own timezone, which is UTC. There is no
timezone setting.

## Condition

Combines the results of several upstream nodes into one decision.

| Field    | Type                                     | Notes                                                        |
| -------- | ---------------------------------------- | ------------------------------------------------------------ |
| Mode     | `all`, `majority`, `minority`, `average` | Default `all`                                                |
| Mappings | list                                     | Which upstream nodes to read, and the value each should have |

It does not re-evaluate anything. It reads what the named nodes already
decided, which is what lets you express "if two of these three are true".

## Model inheritance

Every node except the trigger and the selection carries a model. By default it
is inherited by walking backwards to the nearest trigger or selection, so a
metric check placed after the trigger measures the triggering model without you
saying so. Switch it to manual to measure a different one.

## Nodes that are not working yet

These appear in the editor palette. They do not currently do what their name
suggests, so leave them out until that changes.

| Node                | State                                                                       |
| ------------------- | --------------------------------------------------------------------------- |
| Model error handler | A workflow containing one fails validation at request time and never routes |
| Streaming check     | Always fails, so its branch is never taken                                  |
| Rate limit check    | Always reports not rate limited, so it never changes anything               |
| Token limit check   | Compares against fixed values rather than the real request                  |

<Warning>
  A model error handler node does not just fail its own branch. It stops the
  whole workflow from validating, so every request that would have been routed
  quietly runs on its original model instead.
</Warning>
