← Documentation home

Recipe 2: Opportunity routing & prioritization

Uses the same design patterns as the Lead Qualification flow, applied to pipeline objects.

Business goal

Take opportunity or deal signals and produce priority, owner assignment, and next best action so pipeline hygiene stays consistent.

Prerequisites

When using the built-in CRM, opportunities live on pipelines and Kanban stages; API updates can move pipeline_stage_id to match your routing outcome.

Architecture (logical)

  [Opportunity event] --> [Workflow]
                               |
                 +-------------+-------------+
                 v             v             v
           Rule / score   Agent assist   SLA timer
                 |             |             |
                 +-------------+-------------+
                               v
                    [Owner + priority + follow-up task]

Sample opportunity payload

{
  "opportunity_id": "opp_88421",
  "account_id": "acct_991",
  "stage": "proposal",
  "amount_cents": 12000000,
  "region": "EMEA",
  "owner_id": "usr_legacy"
}

Example: agent evaluation

curl -s -X POST "$API_BASE/api/v1/agents/AGENT_ID/execute" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "opportunity_id": "opp_88421",
      "stage": "proposal",
      "amount_cents": 12000000,
      "region": "EMEA"
    },
    "idempotency_key": "opp-88421-route-20260402"
  }'

Illustrative routing output

{
  "priority": "P1",
  "assigned_owner_id": "usr_enterprise_east",
  "next_action": "exec_review_call",
  "sla_hours": 24,
  "audit_note": "amount > 100k and stage proposal → enterprise pod"
}

What you’ll see in the dashboard (reference)

  1. Workflows: Branch nodes for region or ARR should light up in test mode when you paste the sample opportunity payload.
  2. AI Agents: If scoring runs through an agent, execution history shows structured priority and recommended owner fields.
  3. Monitoring: Watch for spikes in failed executions after CRM field mapping changes.
  4. Team / CRM: Confirm the assigned owner in your CRM matches the routing output; mismatches usually mean outdated branch rules.

Failure & retry

Related: How DripPulse works · Workflow builder