> ## 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.

# connect

> Connect an output port to an input port in an authored pipeline.

```ts theme={null}
import type { Connection, InputPort, OutputPort, PipelineGraphV1 } from "@toloka-platform/sdk";

declare function connect(
  from: OutputPort,
  to: InputPort,
  settings?: PipelineGraphV1["connections"][number]["settings"],
): Connection;
```

## Parameters

**from** `OutputPort` *required*

Source port: root `started`, a work node's `output`, or a Match node's `matched(index)` or `default`.

**to** `InputPort` *required*

Destination port: a work node's `input` or root `completed`.

**settings** `Record\<string, unknown\>` (default: \{})

Connection settings stored in the graph. Ordinary connections use the default empty object.

## Returns

**connection** `Connection`

Add it to `definePipeline({ connections })`.

**Connection properties**

**from** `OutputPort`

The supplied source port.

**to** `InputPort`

The supplied destination port.

**settings** `Record\<string, unknown\>`

The supplied settings or `{}`.

TypeScript checks that the first port is an output and the second is an input. `connect` does not check field compatibility. [`definePipeline`](https://docs.platform.toloka.ai/docs/sdk/reference/define-pipeline) checks that the endpoint nodes are declared; use [local and platform validation](https://docs.platform.toloka.ai/docs/sdk/pipelines.md#check-plan-and-apply) for the graph.

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

const text = field("text", { type: "string" });
const boundary = root({ started: [text], completed: [text] });

export default definePipeline({
  fields: [text],
  nodes: [boundary],
  connections: [connect(boundary.started, boundary.completed)],
});
```


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