{"slug":"business/ORGANIZATIONAL_WORKFLOWS","title":"ORGANIZATIONAL WORKFLOWS — Cross-Domain Intelligence","section":"business","sectionLabel":"Business","status":"unclassified","type":"document","path":"business/ORGANIZATIONAL_WORKFLOWS.mdx","bytes":12312,"description":null,"updated":null,"source":"integratewise/Integratewise-docs-wiki","content":"\n\n> **Tier C — Historical.** This document is a point-in-time snapshot preserved for reference. For current architecture, see [CANONICAL_PLATFORM_ARCHITECTURE.md](../architecture/CANONICAL_PLATFORM_ARCHITECTURE.md).\n\n## Philosophy\n\nOrganizations don't work in silos. Teams constantly need context from other domains to make decisions:\n\n- **Sales rep** needs deal metrics (primary) BUT also CSM health score, Finance contract terms, Support ticket count\n- **CSM** needs account metrics (primary) BUT also Sales pipeline for upsells, Finance MRR/churn risk, Support SLA health\n- **Finance** needs invoice/revenue metrics (primary) BUT also Sales pipeline forecast, CSM health/churn probability, Support costs\n\n## Architecture\n\nEach workbench has a **PRIMARY DOMAIN** (80% focus) + **CROSS-DOMAIN CONTEXT** (20% integration):\n\n```\nSales/RevOps Workbench\n├── PRIMARY: Deal metrics, Pipeline, Forecast\n├── SECONDARY CONTEXT:\n│   ├── CSM: account_health_score, nrr_contribution, churn_probability\n│   ├── Finance: contract_terms, mrr, overdue_status\n│   ├── Support: open_incident_count, satisfaction_score\n│   └── Marketing: campaign_source, lead_quality_score\n└── ACTIONS: [view_account_health, view_contract_details, view_incidents, view_campaign]\n```\n\n## Implementation Layers\n\n### Layer 1: Foundation (`org-context.ts`)\n\nDefines **what each domain needs** from other domains:\n\n```typescript\n  sales: {\n    primary: ['deal', 'opportunity', 'account'],\n    secondary_context: {\n      csm: ['account_health_score', 'nrr_contribution', 'churn_probability'],\n      finance: ['contract_terms', 'mrr', 'overdue_status'],\n      support: ['open_incident_count', 'satisfaction_score', 'recent_incidents'],\n    },\n    key_decision: 'Should I pursue this deal? Can we close it?'\n  },\n  csm: {\n    primary: ['account', 'customer_health', 'expansion_opportunity'],\n    secondary_context: {\n      sales: ['pipeline_for_account', 'upsell_opportunity'],\n      finance: ['mrr', 'churn_risk_score', 'contract_renewal_date'],\n      support: ['ticket_sentiment', 'nps_score'],\n    },\n    key_decision: 'Is this account at risk? Can we expand?'\n  },\n  // ... more domains\n};\n```\n\n### Layer 2: Engine (`OrganizationalContextEngine`)\n\nQueries cross-domain data with proper abstractions:\n\n```typescript\nconst context = OrganizationalContextEngine.getEntityContext(\n  entity_id: 'deal_123',\n  entity_type: 'DEAL',\n  requesting_domain: 'sales',\n  spine_data: spineMap\n);\n\n// Returns:\n// {\n//   primary: [deal_123 full row],\n//   secondary_context: {\n//     csm: [{account_health_score: 85, nrr_contribution: 15000}],\n//     finance: [{contract_value: 50000, payment_status: 'paid'}],\n//     support: [{open_incident_count: 2, satisfaction: 4.2}]\n//   },\n//   cross_domain_actions: ['csm:view_account_health', 'finance:view_contract']\n// }\n```\n\n### Layer 3: Component (`CrossDomainContext`)\n\nRenders context widgets with proper UX:\n\n```tsx\n<CrossDomainContext\n  current_domain=\"sales\"\n  secondary_context={{\n    csm: [{account_health_score: 85, ...}],\n    finance: [{contract_terms: '2yr', ...}],\n    support: [{incidents: 1, ...}]\n  }}\n  cross_domain_actions={['csm:view_account', 'finance:view_contract']}\n  onCrossDomainNavigate={(action) => router.push(...)}\n/>\n```\n\n## Key Design Decisions\n\n### 1. Primary vs Secondary Context\n\n**Primary Context (80%)**\n- The main domain's data\n- Fully rendered, detailed\n- Editable if permissions allow\n- Example: Sales workbench shows full deal details\n\n**Secondary Context (20%)**\n- Other domains' relevant data\n- Minimal, compact display\n- Read-only (link to full view in other domain)\n- Example: CSM health score shown inline in Sales deal\n\n### 2. Abstraction Levels\n\nEach domain's context is **abstracted** to show only what matters:\n\n```\nSales workbench viewing a deal:\n- CSM: Shows 3 fields (health_score, churn_probability, nrr_contribution)\n- NOT: All CSM metrics for that account\n- Reason: Sales rep needs \"is account healthy?\" not all CSM data\n\nFinance workbench viewing an account:\n- Sales: Shows 3 fields (pipeline_value, stage, probability)\n- NOT: All sales metrics\n- Reason: Finance needs \"what revenue is coming?\" not all sales data\n```\n\n### 3. Navigation & Linking\n\nClicking cross-domain data navigates with context preserved:\n\n```\nSales rep clicks \"View in CSM\" on a deal\n→ Navigates to CSM workbench\n→ Pre-filters to that account\n→ Shows breadcrumb: \"Sales → [deal_123] → CSM Account View\"\n→ Can navigate back to deal or stay in CSM\n```\n\n### 4. Data Freshness\n\nCross-domain context is **real-time**:\n- Pulls from live Spine rows\n- Refreshes with main metrics refresh\n- Shows \"last updated X minutes ago\"\n- Warns if data older than 1 hour\n\n## Domain-Specific Patterns\n\n### Sales/RevOps Workbench\n\n**Primary focus:**\n- Deal pipeline, forecast, velocity\n- Sales cycle metrics, win rates\n- Territory performance\n\n**Cross-domain context:**\n```\n┌─ CSM Context ─────────────────┐\n│ Account Health: 85             │\n│ Churn Risk: Low               │\n│ NRR Contribution: $15k        │\n│ [View in CSM] →               │\n└───────────────────────────────┘\n\n┌─ Finance Context ──────────────┐\n│ Contract Value: $50k           │\n│ Payment Status: Current        │\n│ MRR: $4.2k                    │\n│ [View in Finance] →            │\n└───────────────────────────────┘\n\n┌─ Support Context ──────────────┐\n│ Open Incidents: 2              │\n│ Satisfaction: 4.2/5           │\n│ Avg Response: 2hrs            │\n│ [View in Support] →            │\n└───────────────────────────────┘\n```\n\n### CSM Workbench\n\n**Primary focus:**\n- Account health scores\n- Expansion opportunities\n- Churn risk flags\n- NRR metrics\n\n**Cross-domain context:**\n```\n┌─ Sales Context ────────────────┐\n│ Pipeline for Account: $180k    │\n│ Upsell Opportunities: 3        │\n│ New Product Fit: High          │\n│ [View in Sales] →              │\n└───────────────────────────────┘\n\n┌─ Finance Context ──────────────┐\n│ Current MRR: $8.2k             │\n│ Contract Renewal: Mar 2025     │\n│ Payment History: Excellent     │\n│ [View in Finance] →            │\n└───────────────────────────────┘\n```\n\n### Finance Workbench\n\n**Primary focus:**\n- Invoice management\n- Revenue recognition\n- Cash flow forecasting\n- Collections\n\n**Cross-domain context:**\n```\n┌─ Sales Context ────────────────┐\n│ Pipeline Forecast: $500k       │\n│ Avg Deal Size: $25k            │\n│ Sales Cycle: 45 days           │\n│ [View in Sales] →              │\n└───────────────────────────────┘\n\n┌─ CSM Context ─────────────────┐\n│ Churn Risk Accounts: 3         │\n│ NRR: 112%                      │\n│ Expansion Probability: 60%     │\n│ [View in CSM] →                │\n└───────────────────────────────┘\n```\n\n## Real Workflows Enabled\n\n### Workflow: Sales Close + CSM Onboarding\n\n1. **Sales rep** closes deal in Sales workbench\n   - Sees Finance contract terms (payment schedule, terms)\n   - Sees Support SLA agreements\n   - Clicks \"Hand off to CSM\" button\n   \n2. **CSM context** is auto-populated from closed deal:\n   - Account created\n   - Health score initialized\n   - Contract renewal date scheduled\n   - Implementation team notified\n\n3. **CSM workbench** shows:\n   - New account with initial health = 50\n   - Sales pipeline for upsells (linked)\n   - Finance MRR projection\n   - Next steps checklist\n\n### Workflow: CSM Detects Churn + Finance Intervenes\n\n1. **CSM** identifies account with health score < 30\n   - Support context shows high ticket volume\n   - Finance context shows invoice overdue\n   - Sales context shows no pipeline activity\n   \n2. **CSM clicks \"View Financial Status\"**\n   - Navigates to Finance workbench\n   - Pre-filtered to this account's invoices\n   - Finance team can adjust payment terms or offer discount\n\n3. **Finance closes account**\n   - Health score auto-updates in CSM\n   - Support team notified of resolution\n   - Sales team flagged for win-back opportunity\n\n### Workflow: Engineering Incident → Impact\n\n1. **Engineering incident** marked critical\n   - Shows \"Customers affected: 127\"\n   - Lists top 10 affected accounts\n\n2. **CSM context** appears in incident view:\n   - Account health scores for affected accounts\n   - Recent expansion opportunities (now at risk)\n   - NRR impact calculation\n\n3. **CSM clicks incident from own workbench:**\n   - Sees system status in-line\n   - Can notify affected customers\n   - Tracks how incident affects churn probability\n\n## Implementation Pattern\n\nFor each workbench:\n\n### 1. Define Domain Needs (one time)\n\n```typescript\n  your_domain: {\n    primary: ['entity_type_1', 'entity_type_2'],\n    secondary_context: {\n      other_domain_1: ['field_a', 'field_b'],\n      other_domain_2: ['field_c', 'field_d'],\n    },\n    key_decision: 'What decision does this workbench enable?'\n  }\n};\n```\n\n### 2. Compute Context (in workbench)\n\n```typescript\nconst spineData = new Map([\n  ['spine_deals', deal_rows],\n  ['spine_accounts', account_rows],\n  // ... all domains\n]);\n\nconst context = OrganizationalContextEngine.getEntityContext(\n  selected_deal_id,\n  'DEAL',\n  'sales',\n  spineData\n);\n```\n\n### 3. Render Component (in JSX)\n\n```tsx\n<CrossDomainContext\n  current_domain=\"sales\"\n  secondary_context={context.secondary_context}\n  cross_domain_actions={context.cross_domain_actions}\n  onCrossDomainNavigate={handleNavigation}\n/>\n```\n\n## Guidelines\n\n### DO\n\n✓ Show only 3-5 key fields per domain  \n✓ Make cross-domain actions one-click  \n✓ Keep secondary context compact and read-only  \n✓ Preserve navigation context (breadcrumbs, back button)  \n✓ Show \"last updated\" time for freshness  \n✓ Handle missing data gracefully (show \"not connected yet\")  \n\n### DON'T\n\n✗ Show all fields from other domains (too overwhelming)  \n✗ Allow editing of cross-domain data (stay in owner domain)  \n✗ Make navigation complex (one button to view full context)  \n✗ Break domain boundaries (Sales workbench is for sales, not CSM data)  \n✗ Assume all domains are connected (warn if critical data missing)  \n\n## What This Enables\n\n1. **Informed Decision Making**\n   - Sales rep knows account health before closing deal\n   - CSM knows sales pipeline before account review\n   - Finance knows CSM health scores before forecasting\n\n2. **Seamless Handoffs**\n   - Deal closes → CSM account created automatically\n   - CSM flags churn → Finance sees payment issues\n   - Support incident → CSM notified of impact\n\n3. **Cross-Team Collaboration**\n   - Everyone sees related data without context switching\n   - One-click to dive deeper in other domain\n   - Natural workflow without tool fragmentation\n\n4. **Real-Time Organization View**\n   - Sales, CSM, Finance all aligned on same accounts\n   - Pipeline forecast based on actual CSM health\n   - Churn risk visible to entire organization\n\n## Files\n\n- `foundation/org-context.ts` (413 lines) — Domain needs, engine, patterns\n- `components/cross-domain-context.tsx` (180 lines) — UI component\n- `workbenches/sales-revops-workbench.tsx` (updated) — Integration example\n\n## Next Steps\n\n1. Review `org-context.ts` DOMAIN_NEEDS mapping\n2. Add cross-domain context to all 12 workbenches (copy Sales pattern)\n3. Test workflows end-to-end\n4. Gather feedback on what context matters most\n5. Iterate on abstraction levels (show more/less fields)\n\n---\n\n**The goal: Your workbenches feel like one integrated system, not 12 separate tools.**\n\n"}