Discover a live contract before provider work
Do not copy a provider ID or payload from an old example. Search the current workspace, then read the schema before you add a provider action:deepline tools get free_simple_company_search --json remains a
backward-compatible alias for tools describe; prefer describe in new
automation.
Save this first example as lead-routing.play.ts. Keep it decision-only and
validate it before you add provider work:
The authoring contract
A deployable Play has one defaultdefinePlay(...) export, typed input, a
plain-object return value, and a non-empty description. The handler runs in
Deepline; ctx.* records the work that it performs.
lead_id, so a failed row is visible rather than silently dropped.
Choose the runtime primitive
Use
ctx.runPlay(...) for a Play, not ctx.tools.execute(...). A tool is one
provider-backed operation. A child Play is reusable business logic and must be
small enough to run inline; a child that owns a dataset, CSV, event wait, or
explicit timeout must run as a top-level Play instead.
Validate before deployment or spend
Add operational guardrails
Put durable operational policy next to the code it governs:Next steps
Prebuilt Plays
Discover a maintained Play or compose a scalar child Play.
SDK reference
Read the exact
definePlay, ctx, dataset, and tool contracts.