Getting Started With Deepline Plays
Deepline GTM work is paid uncertainty reduction. The play is the notebook, stable ids are the cache, datasets are durable row state, getters are the interface, and CSV is an input/output boundary. Start from live Deepline contracts, then run exactly or build a small durable wrapper.
Default rule: every user request is fresh unless the user names a project, play file, run id, saved play, or asks to continue prior work. Do not inspect old local .play.ts, README, or CSV files for route evidence.
Run one Deepline command at a time when you need its output. Avoid jq, shell parsing, background jobs, raw curl, env spelunking, or local provider probes around Deepline commands. JSON output is for reading directly.
Core Loop
- Preflight: check auth/health/balance when spend or cloud execution is likely.
- Describe before spend:
plays search -> plays describe; for tools, tools search -> tools describe.
- Choose direct vs build: direct-run only when the described contract exactly matches input, output, export, freshness, and pricing. Otherwise bootstrap/wrap/fork.
- Check before run:
plays describe is the gate for prebuilts; plays check <file> is mandatory for local, bootstrapped, or forked plays.
- Pilot before scale: run 1-3 rows or a small sample, then inspect/export.
- Report reality: run id, export path, charged credits or why not visible, executed/reused/failed counts when available, and repair class.
Safe planning-only commands: auth/health/balance, plays search, plays describe, tools search, tools describe, plays check, plays bootstrap --help, and local scaffolding. Do not call plays run or provider execution in planning-only mode.
Which Piece?
| Situation |
Use |
First commands |
Gate |
| Known play/prebuilt may fit exactly |
This page + run/export reference |
deepline plays describe prebuilt/<name> --json |
Input/output/export/pricing/freshness match |
| CSV needs aliases, validation, projection, or join |
This page + run/export reference |
plays describe, inspect headers, plays bootstrap |
plays check and pilot pass |
| Find companies, contacts, or TAM |
references/find-companies-contacts-tam.md + this page |
plays search "company list TAM...", fallback tools search |
Criteria, evidence, count/sample basis, and cost are legible |
| Company -> contacts -> email/phone |
Company/contact/TAM reference + this page |
search/describe company, people, and channel contracts |
Pilot proves account grain and contact identity |
| API/cron/webhook monitor |
This page + generated refs + run/export reference |
plays bootstrap --help, generated SDK/API refs |
Trigger, input, side effects, and pilot are isolated |
| Billing/rerun/debug/export question |
references/run-export-inspect-repair.md first |
runs get, runs export, runs logs |
No paid rerun until run metadata is understood |
Find And Describe
Names are hints. Live search and describe are source of truth.
deepline plays search "<job words>" --json
deepline plays describe prebuilt/<candidate> --json
deepline tools search "<provider need>" --categories <category> --json
deepline tools describe <tool-id> --json
Rules:
plays search defaults to trusted Deepline-managed prebuilts. Use --all only when the user explicitly names or asks for their own/user/org play.
- Search results are candidates. Describe before using them.
- Do not use
tools describe for a prebuilt play.
- Job-change/email/phone/LinkedIn/contact workflows are live play searches, not job docs.
- If the task is account sourcing, contacts, provider strategy, signals, or TAM, load
references/find-companies-contacts-tam.md.
Contract checklist from plays describe / tools describe:
- canonical reference and namespace
- owner/editability/cloneability
- scalar, CSV, or API input modes
- required fields and accepted aliases
- output object and row dataset shape
- nested paths and flattened export headers
- pricing and billing mode
- freshness/staleness behavior
- direct-run vs bootstrap/wrap/fork constraints
- run/export/clone starter commands
- declared getters such as
result.extractedValues.email?.get()
Direct Prebuilt Run
Direct-run only when exact:
- described scalar/CSV/API input matches the user input
- no CSV mapping or semantic repair is needed
- output schema includes the requested result
- export dataset path is known
- freshness/caching behavior is acceptable
- pricing mode and likely scale are acceptable
Typical flow:
deepline plays describe prebuilt/<name> --json
deepline plays run prebuilt/<name> --input '{"field":"value"}' --watch
deepline runs get <run-id> --full --json
deepline runs export <run-id> --dataset result.rows --out rows.csv
For CSV prebuilts, compare required headers to actual headers. If aliases are unsupported or output projection is custom, bootstrap a wrapper instead of editing the prebuilt.
Bootstrap, Wrap, Fork
Bootstrap is the composition tool. It is not anti-prebuilt.
Bootstrap/wrap when:
- CSV headers need mapping, validation, or projection
- a prebuilt is a useful stage but not the whole answer
- company rows need people/contact/channel fanout
- provider source rows need durable row state
- final output needs flat user-facing columns
- row gates, fallback legs, miss reasons, or stale policy matter
Fork when internals need to change:
- provider/tool order
- internal stale policy
- getter metadata
- billing stage
- native prebuilt logic
Do not fork for simple CSV aliases or final formatting. Wrap instead.
deepline plays bootstrap <family> --from <source> --using play:prebuilt/<candidate> --limit 5 --out workflow.play.ts
deepline plays get prebuilt/<name> --source --out fork.play.ts
deepline plays check workflow.play.ts
Route families: people-list, company-list, people-email, people-phone, company-people, company-people-email, company-people-phone.
If bootstrap syntax fails, run deepline plays bootstrap --help or route help and retry with explicit stage flags such as --people, --email, or --phone.
Authoring Basics
Use the current V2 shape from generated references when exact syntax matters:
import { definePlay } from 'deepline';
type Input = { limit?: number };
export default definePlay(
'gtm-play',
async (ctx, input: Input = {}) => {
return { ok: true, limit: input.limit ?? 5 };
},
{ billing: { maxCreditsPerRun: 50 } },
);
Authoring rules:
- Prefer typed inline input. Import validators only if generated refs or bootstrap output prove they exist.
- Use
ctx.csv, ctx.dataset, ctx.tools.execute, ctx.runPlay, ctx.step, ctx.fetch, and ctx.secrets.
- Do not use local
fs, raw fetch, shell commands, env reads, Date.now, or Math.random inside play bodies.
- Use stable ids for paid work. Rename ids only to refresh wrong/stale provider data or changed semantics.
- Return datasets for CSV/exportable outputs.
- Use declared getters. Do not parse raw payload paths when
extractedValues.*.get() exists.
- Project to flat user-facing columns with
status, miss_reason, evidence/source, and requested output fields.
Dynamic staleness pattern:
.withColumn("job_change", {
run: async ({ row, ctx, previousCell }) => {
if (previousCell?.value.status === "stale_contact") {
return previousCell.value;
}
return await checkJobChange(row, ctx);
},
staleAfterSeconds: (value) =>
value.status === "stale_contact" ? null : 30 * 24 * 60 * 60,
})
Semantics:
value is the new value returned by run.
null stale time means no next expiry.
- Existing cells with missing stale metadata may schedule once to backfill.
- The
previousCell guard avoids paying again during metadata backfill.
Load References
Load only when the task needs it:
references/find-companies-contacts-tam.md (Find Companies, Contacts, And TAM): account sourcing, contacts, TAM, portfolio/investor lists, hiring-qualified companies, signals, personas, provider playbooks, account-first strategy, evidence, or fanout economics.
references/run-export-inspect-repair.md (Run, Export, Inspect, Repair): before scale; after every meaningful run; for billing, rerun, export, cached rows, failed rows, logs, suspicious output, partial repair, or UI/run mismatch.
references/sdk-reference.md: exact current SDK signatures.
references/api-reference.md: exact API/manual invocation, polling, streaming, stop, list, inspect/export, and artifact routes.
Do not load a separate reference for ordinary prebuilt search/describe/run, CSV contracts, bootstrap, wrapping, or forking. Those basics are here.
Finish Shape
When work ran, summarize:
- route and play reference
- run id
- rows requested and returned
- executed/reused/failed counts when visible
- charged credits or why credits are missing/zero
- export path and dataset path
- miss/failure classes
- next action: scale, rerun, repair, or stop
When no paid run happened, say so explicitly and list the safe commands used.
1---2name: deepline-plays3description: Use for Deepline Plays/CLI V2 work: get started, find/describe/run prebuilts, process CSVs, bootstrap/wrap/fork plays, author durable V2 workflows, find companies or contacts, size TAM, inspect/export runs, explain billing, and repair failures. Triggers on deepline CLI work, plays, prebuilts, CSV enrichment, prospecting, TAM, provider routing, play authoring, staleAfterSeconds, datasets, runs, exports, billing, and eval-style GTM tasks.4---5
6# Getting Started With Deepline Plays
7
8Deepline GTM work is paid uncertainty reduction. The play is the notebook, stable ids are the cache, datasets are durable row state, getters are the interface, and CSV is an input/output boundary. Start from live Deepline contracts, then run exactly or build a small durable wrapper.
9
10Default rule: every user request is fresh unless the user names a project, play file, run id, saved play, or asks to continue prior work. Do not inspect old local `.play.ts`, README, or CSV files for route evidence.
11
12Run one Deepline command at a time when you need its output. Avoid `jq`, shell parsing, background jobs, raw `curl`, env spelunking, or local provider probes around Deepline commands. JSON output is for reading directly.
13
14## Core Loop
15
161. **Preflight:** check auth/health/balance when spend or cloud execution is likely.
172. **Describe before spend:** `plays search` -> `plays describe`; for tools, `tools search` -> `tools describe`.
183. **Choose direct vs build:** direct-run only when the described contract exactly matches input, output, export, freshness, and pricing. Otherwise bootstrap/wrap/fork.
194. **Check before run:** `plays describe` is the gate for prebuilts; `plays check <file>` is mandatory for local, bootstrapped, or forked plays.
205. **Pilot before scale:** run 1-3 rows or a small sample, then inspect/export.
216. **Report reality:** run id, export path, charged credits or why not visible, executed/reused/failed counts when available, and repair class.
22
23Safe planning-only commands: auth/health/balance, `plays search`, `plays describe`, `tools search`, `tools describe`, `plays check`, `plays bootstrap --help`, and local scaffolding. Do not call `plays run` or provider execution in planning-only mode.
24
25## Which Piece?
26
27| Situation | Use | First commands | Gate |
28| --- | --- | --- | --- |
29| Known play/prebuilt may fit exactly | This page + run/export reference | `deepline plays describe prebuilt/<name> --json` | Input/output/export/pricing/freshness match |
30| CSV needs aliases, validation, projection, or join | This page + run/export reference | `plays describe`, inspect headers, `plays bootstrap` | `plays check` and pilot pass |
31| Find companies, contacts, or TAM | `references/find-companies-contacts-tam.md` + this page | `plays search "company list TAM..."`, fallback `tools search` | Criteria, evidence, count/sample basis, and cost are legible |
32| Company -> contacts -> email/phone | Company/contact/TAM reference + this page | search/describe company, people, and channel contracts | Pilot proves account grain and contact identity |
33| API/cron/webhook monitor | This page + generated refs + run/export reference | `plays bootstrap --help`, generated SDK/API refs | Trigger, input, side effects, and pilot are isolated |
34| Billing/rerun/debug/export question | `references/run-export-inspect-repair.md` first | `runs get`, `runs export`, `runs logs` | No paid rerun until run metadata is understood |
35
36## Find And Describe
37
38Names are hints. Live `search` and `describe` are source of truth.
39
40```bash
41deepline plays search "<job words>" --json
42deepline plays describe prebuilt/<candidate> --json
43deepline tools search "<provider need>" --categories <category> --json
44deepline tools describe <tool-id> --json
45```
46
47Rules:
48
49- `plays search` defaults to trusted Deepline-managed prebuilts. Use `--all` only when the user explicitly names or asks for their own/user/org play.
50- Search results are candidates. Describe before using them.
51- Do not use `tools describe` for a prebuilt play.
52- Job-change/email/phone/LinkedIn/contact workflows are live play searches, not job docs.
53- If the task is account sourcing, contacts, provider strategy, signals, or TAM, load `references/find-companies-contacts-tam.md`.
54
55Contract checklist from `plays describe` / `tools describe`:
56
57- canonical reference and namespace
58- owner/editability/cloneability
59- scalar, CSV, or API input modes
60- required fields and accepted aliases
61- output object and row dataset shape
62- nested paths and flattened export headers
63- pricing and billing mode
64- freshness/staleness behavior
65- direct-run vs bootstrap/wrap/fork constraints
66- run/export/clone starter commands
67- declared getters such as `result.extractedValues.email?.get()`
68
69## Direct Prebuilt Run
70
71Direct-run only when exact:
72
73- described scalar/CSV/API input matches the user input
74- no CSV mapping or semantic repair is needed
75- output schema includes the requested result
76- export dataset path is known
77- freshness/caching behavior is acceptable
78- pricing mode and likely scale are acceptable
79
80Typical flow:
81
82```bash
83deepline plays describe prebuilt/<name> --json
84deepline plays run prebuilt/<name> --input '{"field":"value"}' --watch
85deepline runs get <run-id> --full --json
86deepline runs export <run-id> --dataset result.rows --out rows.csv
87```
88
89For CSV prebuilts, compare required headers to actual headers. If aliases are unsupported or output projection is custom, bootstrap a wrapper instead of editing the prebuilt.
90
91## Bootstrap, Wrap, Fork
92
93Bootstrap is the composition tool. It is not anti-prebuilt.
94
95Bootstrap/wrap when:
96
97- CSV headers need mapping, validation, or projection
98- a prebuilt is a useful stage but not the whole answer
99- company rows need people/contact/channel fanout
100- provider source rows need durable row state
101- final output needs flat user-facing columns
102- row gates, fallback legs, miss reasons, or stale policy matter
103
104Fork when internals need to change:
105
106- provider/tool order
107- internal stale policy
108- getter metadata
109- billing stage
110- native prebuilt logic
111
112Do not fork for simple CSV aliases or final formatting. Wrap instead.
113
114```bash
115deepline plays bootstrap <family> --from <source> --using play:prebuilt/<candidate> --limit 5 --out workflow.play.ts
116deepline plays get prebuilt/<name> --source --out fork.play.ts
117deepline plays check workflow.play.ts
118```
119
120Route families: `people-list`, `company-list`, `people-email`, `people-phone`, `company-people`, `company-people-email`, `company-people-phone`.
121
122If bootstrap syntax fails, run `deepline plays bootstrap --help` or route help and retry with explicit stage flags such as `--people`, `--email`, or `--phone`.
123
124## Authoring Basics
125
126Use the current V2 shape from generated references when exact syntax matters:
127
128```ts
129import { definePlay } from 'deepline';
130
131type Input = { limit?: number };
132
133export default definePlay(
134 'gtm-play',
135 async (ctx, input: Input = {}) => {
136 return { ok: true, limit: input.limit ?? 5 };
137 },
138 { billing: { maxCreditsPerRun: 50 } },
139);
140```
141
142Authoring rules:
143
144- Prefer typed inline input. Import validators only if generated refs or bootstrap output prove they exist.
145- Use `ctx.csv`, `ctx.dataset`, `ctx.tools.execute`, `ctx.runPlay`, `ctx.step`, `ctx.fetch`, and `ctx.secrets`.
146- Do not use local `fs`, raw `fetch`, shell commands, env reads, `Date.now`, or `Math.random` inside play bodies.
147- Use stable ids for paid work. Rename ids only to refresh wrong/stale provider data or changed semantics.
148- Return datasets for CSV/exportable outputs.
149- Use declared getters. Do not parse raw payload paths when `extractedValues.*.get()` exists.
150- Project to flat user-facing columns with `status`, `miss_reason`, evidence/source, and requested output fields.
151
152Dynamic staleness pattern:
153
154```text
155.withColumn("job_change", {
156 run: async ({ row, ctx, previousCell }) => {
157 if (previousCell?.value.status === "stale_contact") {
158 return previousCell.value;
159 }
160
161 return await checkJobChange(row, ctx);
162 },
163 staleAfterSeconds: (value) =>
164 value.status === "stale_contact" ? null : 30 * 24 * 60 * 60,
165})
166```
167
168Semantics:
169
170- `value` is the new value returned by `run`.
171- `null` stale time means no next expiry.
172- Existing cells with missing stale metadata may schedule once to backfill.
173- The `previousCell` guard avoids paying again during metadata backfill.
174
175## Load References
176
177Load only when the task needs it:
178
179- `references/find-companies-contacts-tam.md` (**Find Companies, Contacts, And TAM**): account sourcing, contacts, TAM, portfolio/investor lists, hiring-qualified companies, signals, personas, provider playbooks, account-first strategy, evidence, or fanout economics.
180- `references/run-export-inspect-repair.md` (**Run, Export, Inspect, Repair**): before scale; after every meaningful run; for billing, rerun, export, cached rows, failed rows, logs, suspicious output, partial repair, or UI/run mismatch.
181- `references/sdk-reference.md`: exact current SDK signatures.
182- `references/api-reference.md`: exact API/manual invocation, polling, streaming, stop, list, inspect/export, and artifact routes.
183
184Do not load a separate reference for ordinary prebuilt search/describe/run, CSV contracts, bootstrap, wrapping, or forking. Those basics are here.
185
186## Finish Shape
187
188When work ran, summarize:
189
190- route and play reference
191- run id
192- rows requested and returned
193- executed/reused/failed counts when visible
194- charged credits or why credits are missing/zero
195- export path and dataset path
196- miss/failure classes
197- next action: scale, rerun, repair, or stop
198
199When no paid run happened, say so explicitly and list the safe commands used.