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

# Call Plays

> Run plays from the CLI, TypeScript SDK, another play, or raw HTTP. Use it to pilot on a few rows, verify the output, and scale the workflow safely.

Job: trigger the same workflow from the place your team already works.

## CLI: run a local file

```bash theme={null}
deepline plays check enrich.play.ts
deepline plays run enrich.play.ts --input '{"domain":"stripe.com"}' --watch
```

## CLI: run a named play

```bash theme={null}
deepline plays run prebuilt/person-linkedin-to-email \
  --input '{"linkedin_url":"https://www.linkedin.com/in/example-person/"}' \
  --watch
```

## TypeScript: call from an app or script

TypeScript apps can call the same workflow the CLI runs.

```ts theme={null}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const job = await deepline.play('prebuilt/person-linkedin-to-email').run({
  linkedin_url: 'https://www.linkedin.com/in/example-person/',
});
const result = await job.get();
console.log(result);
```

## Inside another play

```ts theme={null}
import { definePlay } from 'deepline';

export default definePlay(
  'call-enrichment-step',
  async (ctx, input: { domain: string }) => {
    const company = await ctx.tools.execute({
      id: 'company_lookup',
      tool: 'test_rate_limit',
      input: { key: input.domain },
      description: 'Look up one company.',
    });

    return { company_status: company.status };
  },
);
```

Use `ctx.runPlay(...)` for child plays that are statically resolvable in your workspace. Use `ctx.tools.execute(...)` when one provider/tool call is the step you need.

## HTTP: call from any runtime

```bash theme={null}
curl -X POST "$DEEPLINE_HOST_URL/api/v2/plays/run" \
  -H "Authorization: Bearer $DEEPLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"prebuilt/person-linkedin-to-email","input":{"linkedin_url":"https://www.linkedin.com/in/example-person/"}}'
```

The response includes a workflow id. Poll that id until the run finishes.
