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

# match

> Create an authored Match node with named conditions and branch ports.

```ts theme={null}
import type { AuthoredMatchNode, AuthoringIdOptions, MatchAuthoringSettings } from "@toloka-platform/sdk";

declare function match(
  name: string,
  settings: MatchAuthoringSettings,
  options?: AuthoringIdOptions,
): AuthoredMatchNode;
```

## Parameters

**name** `string` *required*

Name used to derive the node ID. Also supply `settings.about.name`.

**settings** `MatchAuthoringSettings` *required*

Field bindings and branch conditions. See the [Match node reference](https://docs.platform.toloka.ai/docs/data/reference/nodes/match.md) for routing behavior.

**Authoring settings**

**about** `MatchNodeSettings['about']` *required*

Node name and optional description.

**input** `readonly \{ field: Field; optional: boolean \}[]` *required*

Fields available to conditions. Use declared field objects.

**conditions** `readonly object[]` *required*

Ordered conditions. Each supplies a name and predicates.

**Condition properties**

**name** `string` *required*

Unique 2–32 character name: lowercase letters, numbers, or underscores; starts with a letter and ends with a letter or number.

**logic** `'and' | 'or'` (default: and)

How predicates in this condition combine.

**predicates** `readonly object[]` *required*

Each predicate supplies `field: Field`, `jsonPath: string`, `operator: "text_eq" | "text_neq"`, and `value: string | number | boolean | null`.

**options** `AuthoringIdOptions` (default: \{})

Optional identity override.

**Options**

**id** `string`

Explicit graph node ID. Otherwise derived from the node type and name.

## Returns

**node** `AuthoredMatchNode`

A Match node with compiled field references.

**Node properties**

**id** `string`

Graph node ID.

**type** `'match'`

Node type.

**settings** `MatchNodeSettings`

Compiled conditions and input bindings.

**input** `InputPort`

Port for incoming connections.

**default** `OutputPort`

Output when no condition matches.

**matched** `(index: number) =\> OutputPort`

Condition output by zero-based index. `matched(0)` addresses the first condition. This helper does not check the index bounds.

## Throws

Throws a local error for an empty, malformed, too-short, too-long, or duplicate condition name. These are ordinary errors, not `PipelineGraphValidationError`.

```ts theme={null}
import { field, match } from "@toloka-platform/sdk";

const label = field("label", { type: "string" });

export const route = match("route", {
  about: { name: "route" },
  input: [{ field: label, optional: false }],
  conditions: [
    {
      name: "accepted",
      predicates: [
        {
          field: label,
          jsonPath: "$",
          operator: "text_eq",
          value: "accepted",
        },
      ],
    },
  ],
});

console.log(route.matched(0).handle, route.default.handle);
```

```text theme={null}
matched_0 default
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.