← Documentation home

Recipe 1: Inbound lead qualification

Canonical Lead Qualification Agent story—reuse this example in onboarding, API demos, and monitoring playbooks.

Business goal

Automatically score, classify, and route inbound leads so the right rep sees the right account fast, with a clear audit trail.

Prerequisites

Architecture (logical)

  [Inbound system] --webhook/API--> [Workflow or agent]
                                         |
                                         +--> Enrichment / lookup (integration step)
                                         +--> Lead Qualification Agent (score, tier, reason)
                                         +--> Routing decision (owner / queue)
                                         +--> CRM update + outbound webhook / email

Setup steps

  1. Create or select a project to hold the workflow.
  2. Issue an API key for automation (see Production readiness).
  3. Deploy the Lead Qualification Agent from a template via dashboard or POST /api/v1/agents/spawn.
  4. Author a workflow: trigger (schedule or webhook) → filter → agent step → action steps (CRM update, outbound webhook).
  5. Test with POST /api/v1/workflows/:id/test and sample payloads.
  6. Promote workflow status and monitor executions.

Sample inbound payload

{
  "email": "alex@acme.example",
  "company": "Acme Corp",
  "source": "paid_search",
  "title": "VP Operations",
  "country": "US"
}

Example API: score via agent

curl -s -X POST "$API_BASE/api/v1/agents/AGENT_ID/score_lead" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "lead": { "email": "alex@acme.example", "company": "Acme Corp" },
    "idempotency_key": "inb-evt-2026-04-02-abc123"
  }'

Illustrative output (structure varies by template)

{
  "score": 0.82,
  "tier": "A",
  "recommended_owner_id": "usr_team_east",
  "reason_summary": "Strong firmographic fit; enterprise title",
  "approval_required": false
}

What you’ll see in the dashboard (reference)

Labels match the product navigation at time of writing; use Monitoring + Agents if your theme differs.

  1. AI Agents: After deploy, your Lead Qualification agent appears in the list with status active (or similar). Open the row to see configuration and policy.
  2. Monitoring: Recent runs surface success/failure; drill into an execution to compare input payload vs structured output.
  3. Workflows: If the scoring step lives in a workflow, open the workflow editor — the graph should show trigger → agent or score step → action; use Test with sample JSON and confirm the run log.
  4. Settings → Integrations: When you update CRM, confirm the connection shows healthy auth; failures often appear as integration errors on the execution.
  5. Webhooks (outbound): Under API-managed subscriptions, delivery history shows HTTP status from your receiver — use for “CRM sync never fired” investigations.

Operational notes

Next: Recipe 2 — Opportunity routing