Skip to main content

Examples

Use these as starting points. Each one follows the same rhythm: inspect, pilot, review, then scale. Job: find new companies on a schedule, enrich the new matches, and send qualified accounts to Salesforce.
deepline plays check weekly-new-accounts.play.ts
deepline plays run weekly-new-accounts.play.ts \
  --input '{"query":"B2B SaaS companies hiring RevOps","salesforce_owner":"alex@acme.com"}' \
  --watch

deepline runs export <run-id> --out output/new-accounts.csv

Lead email waterfall

Job: take a lead list and return verified work emails. If you are outside the repo, create a starter CSV first:
cat > leads.csv <<'CSV'
lead_id,first_name,last_name,linkedin_url,company_name,company_domain
lead-001,Jane,Smith,https://www.linkedin.com/in/example-person/,ExampleCo,example.com
lead-002,Sam,Lee,https://www.linkedin.com/in/example-two/,Acme,acme.com
CSV
deepline plays check lead-email-waterfall.play.ts

head -n 4 leads.csv > /tmp/leads-pilot.csv

deepline plays run lead-email-waterfall.play.ts \
  --csv /tmp/leads-pilot.csv \
  --watch

deepline runs export <run-id> --out /tmp/leads-pilot-enriched.csv
Inspect /tmp/leads-pilot-enriched.csv. Then run the full file:
deepline plays run lead-email-waterfall.play.ts \
  --csv leads.csv \
  --watch

deepline runs export <run-id> --out leads-enriched.csv

Inbound lead webhook

Job: enrich a new form fill before routing it.
deepline plays check inbound-lead-webhook.play.ts
deepline plays publish inbound-lead-webhook.play.ts

Nightly account refresh

Job: refresh account signals every morning with a run cap.
deepline plays check nightly-account-refresh.play.ts
deepline plays publish nightly-account-refresh.play.ts
deepline plays run docs-nightly-account-refresh --input '{"accounts":[]}' --watch

Segment-specific routing

Job: run a different workflow depending on who the buyer is.
import { definePlay } from 'deepline';

type Lead = {
  lead_id: string;
  seniority: 'VP' | 'Director';
  company_domain: string;
};

export default definePlay('segment-specific-routing', async (ctx, input: { leads: Lead[] }) => {
  const rows = await ctx
    .dataset('routed_leads', input.leads)
    .withColumn('next_step', async (lead, rowCtx) => {
      if (lead.seniority === 'VP') {
        return await rowCtx.tools.execute({
          id: 'vp_research',
          tool: 'test_rate_limit',
          input: { key: lead.company_domain },
          description: 'Research this enterprise lead.',
        });
      }

      return await rowCtx.tools.execute({
        id: 'director_research',
        tool: 'test_rate_limit',
        input: { key: lead.company_domain },
        description: 'Research this midmarket lead.',
      });
    })
    .run({ key: 'lead_id' });

  return { rows };
});
Use this when VPs need account-level context and directors need more tactical pain-point research.

Python caller

Job: trigger a prebuilt play from a Python process.
python3 -m pip install requests
cat >.env.deepline <<'ENV'
DEEPLINE_HOST_URL=https://code.deepline.com
DEEPLINE_API_KEY=dl_workspace_key
ENV
python3 docs-examples/sdk-v2/http-python/run_prebuilt.py
The script reads .env.deepline directly. Use this from Airflow, a notebook, or a backend worker.