Skip to main content
Fields describe the data contract, nodes describe the work, and connections describe how data moves through a Data Labeling pipeline. Keep these definitions in TypeScript so your team and coding agents can review and test changes. Pipeline authoring covers Data Labeling. To operate Training or Models, use the SDK client, CLI, or HTTP API.

Set up a project

Install Bun and the SDK and the standalone CLI. Existing SDK projects use bun install to restore their dependencies. Run toloka init from the project root to install the CLI’s bundled coding-agent guidance. To bind this directory to a project, pass --project-id, set TOLOKA_PROJECT_ID, or use an existing toloka.json binding. Selecting a project with project switch alone does not bind init. After updating the CLI, run toloka init again to refresh its guidance. Updating the SDK dependency alone does not update the CLI.

Define fields and a pipeline

Save each pipeline in a file named pipeline.ts under pipelines/, with a default export from definePipeline:
pipelines/example/pipeline.ts
dataset names the platform dataset. field() declares a field and its JSON Schema. root() defines the fields that enter and leave the pipeline; it takes no name argument. Use code(), generation(), quorum(), and match() to add work. Their reference pages describe the authoring arguments and link to the node settings.

Connect nodes

connect() takes an output port and an input port. TypeScript checks the port direction. definePipeline() checks that referenced fields and connection endpoints are declared, then builds the graph. Reuse the same Field objects in node settings and the pipeline’s fields array. A new field() call with the same name is a different object and does not satisfy that declaration check. Keep dataset rows, API keys, and secret values out of pipeline source. Author secret names in node settings and set their values through the CLI.

Check, plan, and apply

Add local tests, authenticate, and select a project. Then run:
check also reports platform-rules warnings with the node and setting path. These warnings do not fail check, but apply refuses new or changed pipelines that violate those rules. Fix them before applying. A final No changes. from plan confirms that source and the platform agree. For project selection, immutable fields, and graph-write restrictions after a run, see the CLI reconciliation loop.

Configure expert onboarding

The Generation constructor’s default onboarding contains one text step and no quiz. Replace it before applying a node with onboarding enabled. A course needs a role, goal, success criteria, 3–6 steps with content, and at least one quiz. Practice and worked examples cannot appear in the same course; worked examples require a built labeling interface. All text within one onboarding setting counts toward its 150,000-character limit. Other settings, such as instruction and ui, have separate limits. Local checks validate course structure and block content; platform checks also exercise worked examples against the labeling interface. Use Generation node onboarding for block contents and course requirements shared with Quorum nodes. Use validate() when you need to validate a graph directly; it checks the local graph contract, while toloka check and platform validation cover additional rules.