---
title: Scoped tasks
description: Even faster Turborepo builds with scoped tasks.
searchable: false
---

import Callout from "../../../../components/Callout";
import HeartIcon from "@heroicons/react/solid/HeartIcon";

<Callout type="error">
  `--scope` is deprecated in `1.2.x`. Please use
  [`--filter`](/repo/docs/core-concepts/monorepos/filtering) instead.
</Callout>

# Scoped Tasks

Scoping task execution can speed up the process especially if there are distinct clusters of workspaces that are not related to each other within your repository. Turborepo has a `scope` option that allows the task running to proceed up to the workspaces found that matches the `scope` argument. It's useful to think of `scope` as an "entry point" into your monorepo's workspace/task graph. This is a string matcher based on the name of the workspaces (not the workspace path).

<Callout type="info">
  It is important to note that dependents and dependencies refer to the
  workspace and task.
</Callout>

## Scoped tasks with all its dependents

By default, it is helpful to be able to run tasks on all affected workspaces within a scope. Workspaces that changed will affect downstream consumers. In this case, pass along the `scope` to build all the dependencies as well.

<Callout type="info">
  You can use wildcard character: `*`. This is particularly helpful when
  workspaces are named by group or by scope.
</Callout>

```sh
turbo run build --scope=*build-tools*
```

## Scoped tasks with no dependents & their dependencies

Sometimes we want to run the tasks needed to satisfy the `build` script of all the workspaces that has the `build-tools` string in their names. Think of this as running tasks up and including the workspace matched in the scope. Add a `--no-deps` flag to run up to a workspace task.

```sh
turbo run build --scope=*build-tools* --no-deps --include-dependencies
```

<Callout type="idea" icon={<HeartIcon className="h-5 w-5 text-gray-400" aria-hidden="true" />}>
Turborepo's Scoped Tasks API design and docs were/are inspired [Microsoft's Lage project](https://microsoft.github.io/lage/docs/Guide/scopes#scoped-builds-with-all-its-dependents) `--scope` flag which was inspired by [Lerna's](https://github.com/lerna/lerna/tree/main/commands/run#readme).

We are working toward a new, more expressive task filtering/scoping syntax. [Read the RFC here.](https://github.com/vercel/turbo/discussions/105)

</Callout>
