Overview

LIS Command Center

Multi-agent business intelligence system for Legacy Insurance Solutions. Connects HubSpot CRM, EZLynx agency management, Slack notifications, and automated analytics into a single operational dashboard.

What It Does

  • Daily briefings with deal pipeline status
  • Real-time alerts for overdue deals and growth insights
  • EZLynx-to-HubSpot sync for insurance policies
  • Automated analytics and performance tracking
  • Slack notifications for team awareness

Tech Stack

  • Database: Supabase (PostgreSQL)
  • Frontend: Vercel (Next.js dashboard)
  • Notifications: Slack Bot
  • CRM: HubSpot (deals, contacts, owners)
  • Automation: n8n Cloud workflows
  • Scraping: Playwright (EZLynx)

HubSpot Owners

Shane (71426339) Sonny / VA (161631961) LISA / Bot (159845197)

Database Tables

daily_briefings deals_snapshot analytics_daily deal_actions alerts growth_insights
Daily Operations

Dashboard & Briefings

The daily briefing system aggregates deal status, analytics, and alerts into a single morning report delivered via Slack and the web dashboard.

Daily Briefing Flow

n8n TriggerDaily at 7:00 AM
HubSpot PullDeals + contacts
AI AnalysisGPT-4o summary
Supabase Writedaily_briefings
Slack Post#lis-command-center

Briefing Data Structure

daily_briefings Table
briefing_dateDate of the briefing (one per day)
deals_summaryJSON: total deals, by stage, by owner, new vs stale
pipeline_valueTotal weighted pipeline value across all stages
ai_insightsGPT-4o generated analysis: trends, risks, opportunities
action_itemsArray of recommended actions for the day
alerts_countNumber of active alerts requiring attention

Dashboard Metrics

  • Pipeline value (total + by product line)
  • Deal velocity (avg days per stage)
  • Win rate (trailing 30/60/90 days)
  • Revenue forecast (weighted pipeline)
  • Owner performance comparison
  • Stale deal count and aging

Slack Integration

  • Channel: #lis-command-center
  • Workspace: legacyinsurancecohq.slack.com
  • Daily briefing: Formatted summary at 7 AM
  • Alerts: Real-time for urgent items
  • Deal actions: When deals need attention
💡
Edge function: process-deal-action is deployed on Supabase Edge Functions. It handles deal action processing when triggered from the dashboard or Slack interactions.
Pipeline

Deal Pipeline

HubSpot deal tracking across multiple insurance product lines. Each product has its own pipeline stages with unique IDs.

Pipeline Stages per Product Line

HubSpot Pipeline Stage IDs
Stage Auto Homeowners Renters / Life
New Lead appointmentscheduled appointmentscheduled appointmentscheduled
Quoting qualifiedtobuy qualifiedtobuy qualifiedtobuy
Proposal Sent presentationscheduled presentationscheduled presentationscheduled
Closed Won closedwon closedwon closedwon
Closed Lost closedlost closedlost closedlost

deals_snapshot Table

Key Fields
hubspot_deal_idHubSpot deal record ID
deal_nameContact name + product line
pipeline_idWhich product line pipeline
stage_idCurrent pipeline stage
owner_idHubSpot owner (Shane, Sonny, or LISA)
amountDeal value (annual premium)
days_in_stageHow long the deal has been in current stage
last_activityTimestamp of last deal activity
snapshot_dateWhen this snapshot was taken

deal_actions Table

Recommended actions generated by the AI analysis engine. Processed by the process-deal-action edge function.

Action Types
follow_upContact needs a follow-up call or email
stage_advanceDeal ready to move to next stage
reassignDeal should be reassigned to different owner
close_staleDeal has been stale too long, recommend closing
escalateHigh-value deal needs manager attention
Intelligence

Alerts & Growth Insights

Proactive monitoring for deal risks and growth opportunities. Alerts fire in real-time; growth insights are generated daily.

Alert Types

alerts Table
stale_dealDeal inactive for 7+ days
overdue_taskScheduled follow-up is past due
high_value_riskDeal >$5K stalling in pipeline
owner_overloadOwner has 15+ active deals
pipeline_gapProduct line has no new leads in 7 days
sync_failureEZLynx sync failed or returned errors

Growth Insights

growth_insights Table
cross_sellClient has Auto but no Home policy
renewal_oppPolicy renewal coming in 30 days
referral_readyHappy client, high satisfaction score
upsellCoverage gap identified in current policy
market_trendProduct line showing growth trajectory

Analytics Daily

analytics_daily Table
dateAnalytics date
new_dealsDeals created today (by product line)
deals_wonDeals closed won today
deals_lostDeals closed lost today
revenue_wonTotal premium from won deals
avg_deal_velocityAverage days from lead to close
conversion_rateWon / (Won + Lost) trailing 30 days
pipeline_valueTotal active pipeline value
⚠️
Alert fatigue: Alerts are deduplicated daily. The same deal won't trigger the same alert type more than once per 24-hour period. Resolved alerts are auto-cleared.
Sync Engine

EZLynx Sync Pipeline

Playwright-based scraper extracts policy data from EZLynx, parses it, matches it against HubSpot contacts, and syncs deal status. Handles the critical quirks of EZLynx's data format.

Sync Pipeline Flow

PlaywrightLogin + scrape EZLynx
CSV ParserExtract policy data
Matching EngineEZLynx ↔ HubSpot
HubSpot APICreate/update deals
ReconciliationVerify + log

Pipeline Stage IDs by Product Line

EZLynx Product → HubSpot Pipeline Mapping
AutoPersonal auto, commercial autoAuto pipeline
HomeownersHO3, HO5, dwelling fireHome pipeline
RentersHO4 (tenant/renter policies)Renters pipeline
LifeTerm, whole, universal lifeLife pipeline
🚨
Critical EZLynx Quirk: Renters Mislabeling
EZLynx labels Renters policies as "Home" or "Homeowners" in its export. The only way to distinguish them is by premium amount: policies under $300/year are Renters, above are true Homeowners. The sync engine applies this $300 threshold automatically.

Couple Name Extraction

EZLynx often stores names as couples:

  • John & Jane Smith → Primary: John Smith
  • Smith, John & Jane → Primary: John Smith
  • John Smith & Jane Doe → Primary: John Smith

The matching engine extracts the primary name for HubSpot lookup. Secondary name is stored as a note.

Renewal vs New Business

The sync engine separates:

  • New Business: No prior policy in EZLynx for this client + product line. Creates a new HubSpot deal.
  • Renewals: Existing policy found. Updates the existing deal and moves to renewal stage rather than creating a duplicate.

Match key: client name + product line + effective date window.

⚠️
EZLynx session handling: EZLynx sessions expire after 15 minutes of inactivity. The Playwright scraper uses keepalive pings and re-authenticates if the session drops mid-scrape.
Verification

Reconciliation Engine

After each sync, the reconciliation engine verifies data integrity between EZLynx and HubSpot. Catches mismatches, duplicates, and missing records.

Reconciliation Flow

Post-SyncTrigger after sync
CompareEZLynx vs HubSpot
Flag IssuesMismatches, dupes
Generate ReportSupabase + Slack

What Gets Checked

Reconciliation Rules
Policy count matchEZLynx export count = HubSpot deal count per product lineAuto
Premium alignmentEZLynx premium matches HubSpot deal amount (within $5 tolerance)Auto
Duplicate detectionSame client + product line should not have multiple active dealsAuto
Orphaned dealsHubSpot deals with no matching EZLynx policyAuto
Missing contactsEZLynx policies with no matching HubSpot contactAuto
Stage consistencyBound policies in EZLynx should be "Closed Won" in HubSpotAuto

Common Reconciliation Fixes

  • Duplicate deal: Merge in HubSpot, keep the one with more activity
  • Premium mismatch: Update HubSpot amount from EZLynx (source of truth)
  • Missing contact: Create contact in HubSpot, then re-run sync
  • Stage mismatch: Update HubSpot stage to match EZLynx policy status

Never Do

  • Don't update EZLynx from HubSpot (EZLynx is source of truth for policies)
  • Don't delete HubSpot deals without checking EZLynx first
  • Don't manually override the $300 Renters threshold
  • Don't ignore sync_failure alerts — they cause data drift
Renewals

Renewal Intelligence Pipeline

Automated weekly pipeline that scrapes policy expiration data from EZLynx, categorizes by urgency, sends Slack alerts, and feeds a visual renewal calendar on the dashboard.

📅 Pipeline Flow

EZLynx Scraperpolicy_expiration report
Renewal Scanner30/60/90d categorization
Slack Alert#lis-command-center
Supabaserenewal_alerts table

🔴 Urgency Tiers

Critical (0-30 days)
Full policy detailUp to 8 shown in Slack
Warning (31-60 days)
Summary with premiums5 shown + count
Watch (61-90 days)
Aggregate countTotal premium at stake

⚙️ SSRS Date Filters

The scraper now sets SSRS ReportViewer date parameters before export:

  • Custom date range — Pass start_date and end_date to any report
  • Historical pullsextract_historical_reports() pulls quarterly data going back 12+ months
  • Auto-detection — Finds SSRS date inputs by known IDs or falls back to panel scanning

🕒 Scheduling

Tool: tools/renewal_pipeline.py — runs as Windows Task Scheduler job

  • Trigger: Weekly, Monday 6:00 AM
  • Action: python renewal_pipeline.py
  • Automatically sets 90-day date filter on the expiration report
  • Sends Slack alert, pushes to Supabase, saves execution log
  • Can be tested with skip_scraper=True to reuse existing data

📈 Dashboard: Renewal Calendar

New dashboard component shows all policies expiring in the next 90 days with interactive urgency tier filtering. Click a tier to expand its policies — each shows client name, LOB, carrier, premium, and countdown.

Cross-Sell

Bundle Tracker & Cross-Sell Detection

Identifies clients with single lines of business and surfaces the highest-value cross-sell opportunities to grow wallet share.

🔮 How It Works

HubSpot APIAll active deals
Group by ClientMatch pipelines to LOBs
Score Opportunities0-100 bundle score
DashboardBundle rate KPI

📊 Bundle Rate KPI

The bundle rate shows the percentage of clients with 2+ active LOBs (e.g., Auto + Home). Higher rates mean better retention and more revenue per customer.

  • Bundled clients — 2+ active pipelines
  • Single LOB clients — Cross-sell targets
  • Top missing LOBs — What to pitch next

🎯 Scoring Algorithm

Score Components
Premium BaseUp to 50 points from existing premium
LOB Bonus15 points per missing common LOB
Max Score100 (high-premium, single-LOB client)

Natural bundles: Auto+Home, Auto+Renters, Home+Umbrella

💻 Dashboard View

The Bundle Tracker component shows:

  • Bundle rate percentage as a prominent KPI
  • Summary cards: Bundled vs Single LOB vs Total clients
  • Top cross-sell demand (most missing LOBs across all clients)
  • Scrollable list of opportunities with existing LOBs → missing LOBs visualization
  • Color-coded LOB tags (Auto=blue, Home=green, Life=pink, etc.)

🛠 NBS/RWL Classification

The parser now auto-classifies transactions as New Business or Renewal when EZLynx's Transaction_Type2 field is missing:

  • Customer Since vs Effective Date — Same year = New Business
  • LOB Origination Date — Matches effective = NBS, earlier = RWL
  • Policy Creation Date — Within 30d of effective = NBS
  • Source Report — Retention/Expiration report = likely RWL
System

Architecture

How all the pieces connect: Supabase as the data layer, n8n as the automation engine, and integrations flowing through APIs.

System Architecture

EZLynxPlaywright scraper
n8n CloudOrchestration
SupabasePostgreSQL + Edge
VercelDashboard UI
HubSpotCRM + deals
n8n CloudBidirectional sync
SlackNotifications

Connection Details

Service Config
SupabaseProject: oipmskrmitcntytkrivi
n8nsmrich.app.n8n.cloud
Slacklegacyinsurancecohq.slack.com
HubSpot3 owners (Shane, Sonny, LISA)
Edge Functionprocess-deal-action

Build Phases

  1. Phase 1-3: Core ✓DB tables, HubSpot sync, dashboard
  2. Phase 4: Notifications ✓Slack alerts, daily briefings, renewal scanner
  3. Phase 5: AI Skills ✓GPT-4o analysis and recommendations
  4. Phase 6: Renewals ✓SSRS date filters, renewal pipeline, calendar view
  5. Phase 7: Cross-Sell ✓Bundle tracker, cross-sell scoring, stale drill-down

Data Flow Summary

Integration Points
EZLynx → SupabasePolicy data scraped and stored for matchingDaily sync
HubSpot → SupabaseDeal snapshots pulled and storedEvery 4 hours
Supabase → HubSpotDeal actions executed (stage changes, assignments)On demand
Supabase → SlackAlerts, briefings, action notificationsReal-time + daily
Supabase → VercelDashboard reads from Supabase directlyReal-time
EZLynx → SlackRenewal alerts (30/60/90d expiration tiers)Weekly
HubSpot → BundleCross-sell analysis pushed to bundle_opportunitiesWeekly
🎉
Walkthrough complete! You now understand the LIS Command Center's architecture, from EZLynx scraping through HubSpot sync, daily briefings, and Slack notifications. Bookmark this page for reference.