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

# Prebuilt Plays

> Discover Deepline-maintained Plays, inspect their contracts, and compose eligible scalar Plays into your own code.

[Human guide: work with your agent →](https://deepline.com/docs/human/sdk-v2/prebuilt-plays.md)

> [!NOTE]
>
> Choose an existing Play by its input and output contract, then decide whether
> it can compose inline.

A Prebuilt Play is a Deepline-maintained Play with a published input and output
contract. It is not a raw provider tool. Use one when the maintained business
flow fits your job. write a Play only when you need your own decision logic.

## Discover and inspect

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline search "name and company domain -> work email" --type prebuilts
deepline describe prebuilt/company-to-contact
```

Inspect the required inputs, output shape, origin, and example command. Ask
whether your records satisfy the input contract before you choose a provider or
build a waterfall.

| Field | Why it matters |
| - | - |
| `name` | The Play reference used by the CLI or SDK |
| `origin` | `prebuilt` identifies a Deepline-maintained Play |
| `inputSchema` | The data your CLI, API call, or CSV workflow must supply |
| `runCommand` | A command shaped for the published contract |

Run a named Prebuilt Play from [Call Plays](https://deepline.com/docs/sdk-v2/calling-plays.md). Pilot a
CSV-capable workflow through [Batch CSV enrichment](https://deepline.com/docs/sdk-v2/batch-csv.md).

## Compose an eligible child Play

Inside a custom Play, use `ctx.runPlay(...)` with a stable call key and a
statically resolvable child reference:

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { definePlay } from 'deepline';

type Input = {
  domain: string;
};

export default definePlay(
  'find-sales-leaders',
  async (ctx, input: Input) => {
    const contacts = await ctx.runPlay(
      'company_contacts',
      'prebuilt/company-to-contact',
      { domain: input.domain, roles: ['Head of Sales'] },
      { description: 'Find sales leaders at this account.' },
    );

    return { contacts };
  },
  {
    description: 'Find sales leaders through a scalar Prebuilt Play.',
  },
);
```

The child returns its result to the parent run. It does not create a separate
public run ID. A child that uses a dataset, reads a CSV, waits for an event, or
sets an explicit runtime timeout is not eligible for inline composition. run
that lifecycle-owning work as a top-level Play.

> [!WARNING]
>
> Do not invoke a Prebuilt Play with `deepline tools execute` or
> `ctx.tools.execute`. Use `deepline plays run`,
> `Deepline.connect().play(...).run(...)`, or `ctx.runPlay(...)` as appropriate
> for the caller.

## When the contract is close but not right

Fetch its source, give your copy a new name, validate it, and publish it to
your workspace. Keep the original Prebuilt Play unchanged so future runs have
an unambiguous owner and revision history.

## Verify this task

Compare required identifiers and result fields. Use scalar composition only when the child satisfies the documented lifecycle boundary.

Ask your agent to explain a failed check before repeating work or expanding the scope.


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