3 Jun 2026Guides
Guides

Claude Code SDK workflows for GTM systems

A practical Claude Code SDK workflow for GTM teams that use Deepline skills first, then deploy scripts and Workflows.

DDeepline

Action and system primitives

Primitive 1: the responsibility boundary

The Claude Code SDK is for agent sessions, permissions, files, and orchestration. Deepline skills are for getting GTM data into a useful shape first. Deepline scripts and Workflows are for deploying the proven motion after the sample is accepted.

Human questionClaude Code handlesDeepline handles
What should the agent do next?prompt, session, planthe skill and data request
Can this workflow run safely?file edits, review loopsample validation and approval points
What happened in the GTM workflow?summary and next-step reportoutput fields, statuses, and next step
Should we scale the run?human approval workflowscripts and Workflows after approval

Primitive 2: the workflow-contract prompt

You are using Claude Code with Deepline skills to validate a GTM workflow.

Workflow goal: enrich and review a lead CSV.
Input file: leads.csv
Required output file: enriched-leads.csv
Required output fields: email, email_status, company_domain, next_step.

Before creating a script or Workflow:
- inspect the CSV headers,
- ask the Deepline skill for a small sample,
- summarize what came back,
- ask for approval before promoting the motion.

After the sample, summarize what changed, what failed, and whether this should become a script or Workflow.

That prompt is the human-facing contract. The SDK and CLI details sit underneath it after the skill proves the data is useful.

Primitive 3: the operator-readable result

Sample run complete.

Rows processed: 10
Ready for outbound: 6
Needs review: 2
Not found: 2

Output file: enriched-leads.csv
Recommendation: review the two needs_review rows, then approve full run.

The operator should never need to decode raw execution logs to understand whether the GTM workflow worked.

How the primitives move through skills, scripts, and Workflows

Start with the Deepline skill. When the skill returns data you trust, promote the same prompt and field contract into a script for repeatable runs or a Deepline Workflow for production handoffs.

The implementation surfaces for SDK-backed scripts and Workflows are:

  1. GET /api/v2/tools
  2. GET /api/v2/tools/search
  3. GET /api/v2/integrations/{toolId}/get
  4. POST /api/v2/enrich/compile
  5. POST /api/v2/plays/check
  6. POST /api/v2/plays/run
  7. GET /api/v2/plays/run/{workflowId}
  8. POST /api/v2/plays/run/{workflowId}/stop

Use the official Claude Agent SDK docs for the agent environment and Deepline docs for skills, scripts, and Workflows. Deepline does not require a Claude Code-specific route for this workflow.

The split is intentional: Claude's SDK controls agent behavior, files, tools, permissions, and sessions. Deepline controls the skill, the data contract, and the script or Workflow that runs after approval.

Script pattern after the skill works

After the skill output is approved, start the script path with auth and discovery:

deepline auth status
deepline tools search email --json
deepline tools describe leadmagic_email_finder --json

Validate a Workflow before execution:

deepline plays check enrich-leads.play.ts

Run the play once validation passes:

deepline plays run --file enrich-leads.play.ts --input '{}' --watch

For CSV enrichment, use the supported enrich JSON object spec:

deepline enrich --input leads.csv \
  --with '{"alias":"email","tool":"leadmagic_email_finder","payload":{"first_name":"{{first_name}}","last_name":"{{last_name}}","domain":"{{domain}}"}}' \
  --output enriched-leads.csv

For waterfall enrichment, keep the waterfall alias inside deepline enrich:

deepline enrich --input leads.csv \
  --with '{"alias":"email","tool":"name_and_domain_to_email_waterfall","payload":{"first_name":"{{first_name}}","last_name":"{{last_name}}","domain":"{{domain}}"}}' \
  --output enriched-leads.csv

Quality check before deploying a Workflow

Use deepline plays check <file.play.ts> to validate play source and artifacts before a run. The matching route is POST /api/v2/plays/check.

Use the Deepline skill to validate the data first. Use deepline tools describe <toolId> --json to validate a provider tool schema before a script or Workflow forms input for execution. This is schema inspection, not a provider-backed run.

No no-spend Claude Code-specific test route is documented. Keep test steps on documented Deepline validation surfaces.

Before scaling, preserve the setup report, sample output, and approval decision. That gives the human a clear audit trail without exposing provider-internal economics.

Cost and billing behavior

Discovery, schema inspection, and play checks are setup and validation steps. Execution is the step that can call provider-backed operations.

For GTM workflows, keep costs Deepline-facing. BYOK mode uses customer-owned provider keys and no Deepline platform fee for that mode. Managed mode uses Deepline credit-based operation billing. Avoid exposing provider-internal economics to the customer or execution logs.

Related Deepline workflows