Back to Nocobase

CRM 2.0 System Design

docs/docs/en/solution/crm/design.md

2.0.5335.3 KB
Original Source

CRM 2.0 System Design

1. System Overview & Design Philosophy

1.1 System Positioning

This system is a CRM 2.0 Sales Management Platform built on the NocoBase no-code platform. The core goal is:

Let salespeople focus on building customer relationships,
not data entry and repetitive analysis.

The system automates routine tasks through workflows and leverages AI to assist with lead scoring, opportunity analysis, and more — helping sales teams work more efficiently.

1.2 Design Philosophy

Principle 1: Complete Sales Funnel

End-to-end sales flow:

Why design it this way?

Traditional ApproachIntegrated CRM
Multiple systems for different stagesSingle system covering the full lifecycle
Manual data transfer between systemsAutomatic data flow and conversion
Inconsistent customer viewsUnified 360° customer view
Fragmented data analysisEnd-to-end pipeline analysis

Principle 2: Configurable Sales Pipeline

Different industries can customize pipeline stages without modifying code.

Principle 3: Modular Design

  • Core modules (Customers + Opportunities) are required; all others are optional
  • Disabling a module requires no code changes — configure via the NocoBase admin UI
  • Each module is independently designed to minimize coupling

2. Module Architecture & Customization

2.1 Module Overview

The CRM system uses a modular architecture — each module can be independently enabled or disabled based on business needs.

2.2 Module Dependencies

ModuleRequiredDepends OnWhen to Disable
Customer Management✅ YesCannot be disabled (core)
Opportunity Management✅ YesCustomer ManagementCannot be disabled (core)
Lead ManagementOptionalNo lead capture needed
Quotation ManagementOptionalOpportunity, ProductSimple deals with no formal quotes
Order ManagementOptionalOpportunity (or Quotation)No order/payment tracking needed
Product ManagementOptionalNo product catalog needed
Email IntegrationOptionalCustomer, ContactUsing an external email system

2.3 Pre-configured Editions

EditionModules IncludedUse CaseTable Count
LiteCustomer + OpportunitySimple deal tracking6
StandardLite + Lead + Quotation + Order + ProductFull sales cycle15
EnterpriseStandard + Email IntegrationFull feature set with email17

2.4 Module–Table Mapping

Core Module Tables (Always Required)

TableModuleDescription
nb_crm_customersCustomer ManagementCustomer/company records
nb_crm_contactsCustomer ManagementContacts
nb_crm_customer_sharesCustomer ManagementCustomer sharing permissions
nb_crm_opportunitiesOpportunity ManagementSales opportunities
nb_crm_opportunity_stagesOpportunity ManagementStage configuration
nb_crm_opportunity_usersOpportunity ManagementOpportunity collaborators
nb_crm_activitiesActivity ManagementActivity records
nb_crm_commentsActivity ManagementComments / notes
nb_crm_tagsCoreShared tags
nb_cbo_currenciesBase DataCurrency dictionary
nb_cbo_regionsBase DataCountry/region dictionary

2.5 How to Disable a Module

Simply hide the module's menu entry in the NocoBase admin panel. No code changes or table deletions required.


3. Core Entities & Data Model

3.1 Entity Relationship Overview

3.2 Core Table Details

3.2.1 Leads Table (nb_crm_leads)

Lead management with a simplified 4-stage workflow.

Stage flow:

New → Working → Qualified → Converted (Customer/Opportunity)
        ↓            ↓
   Unqualified   Unqualified

Key fields:

FieldTypeDescription
idBIGINTPrimary key
lead_noVARCHARLead number (auto-generated)
nameVARCHARContact name
companyVARCHARCompany name
titleVARCHARJob title
emailVARCHAREmail address
phoneVARCHARPhone number
mobile_phoneVARCHARMobile number
websiteTEXTWebsite
addressTEXTAddress
sourceVARCHARLead source: website/ads/referral/exhibition/telemarketing/email/social
industryVARCHARIndustry
annual_revenueVARCHARAnnual revenue range
number_of_employeesVARCHAREmployee count range
statusVARCHARStatus: new/working/qualified/unqualified
ratingVARCHARRating: hot/warm/cold
owner_idBIGINTOwner (FK → users)
ai_scoreINTEGERAI quality score 0–100
ai_convert_probDECIMALAI conversion probability
ai_best_contact_timeVARCHARAI-recommended contact time
ai_tagsJSONBAI-generated tags
ai_scored_atTIMESTAMPAI scoring timestamp
ai_next_best_actionTEXTAI next best action suggestion
ai_nba_generated_atTIMESTAMPAI suggestion generated timestamp
is_convertedBOOLEANConversion flag
converted_atTIMESTAMPConversion timestamp
converted_customer_idBIGINTConverted customer ID
converted_contact_idBIGINTConverted contact ID
converted_opportunity_idBIGINTCreated opportunity ID
lost_reasonTEXTLoss reason
disqualification_reasonTEXTDisqualification reason
descriptionTEXTDescription

3.2.2 Customers Table (nb_crm_customers)

Customer/company management with foreign trade support.

Key fields:

FieldTypeDescription
idBIGINTPrimary key
nameVARCHARCustomer name (required)
account_numberVARCHARAccount number (auto-generated, unique)
phoneVARCHARPhone number
websiteTEXTWebsite
addressTEXTAddress
industryVARCHARIndustry
typeVARCHARType: prospect/customer/partner/competitor
number_of_employeesVARCHAREmployee count range
annual_revenueVARCHARAnnual revenue range
levelVARCHARLevel: normal/important/vip
statusVARCHARStatus: potential/active/dormant/churned
countryVARCHARCountry
region_idBIGINTRegion (FK → nb_cbo_regions)
preferred_currencyVARCHARPreferred currency: CNY/USD/EUR
owner_idBIGINTOwner (FK → users)
parent_idBIGINTParent company (FK → self)
source_lead_idBIGINTSource lead ID
ai_health_scoreINTEGERAI health score 0–100
ai_health_gradeVARCHARAI health grade: A/B/C/D
ai_churn_riskDECIMALAI churn risk 0–100%
ai_churn_risk_levelVARCHARAI churn risk level: low/medium/high
ai_health_dimensionsJSONBAI health dimension scores
ai_recommendationsJSONBAI recommendation list
ai_health_assessed_atTIMESTAMPAI health assessment timestamp
ai_tagsJSONBAI-generated tags
ai_best_contact_timeVARCHARAI-recommended contact time
ai_next_best_actionTEXTAI next best action suggestion
ai_nba_generated_atTIMESTAMPAI suggestion generated timestamp
descriptionTEXTDescription
is_deletedBOOLEANSoft delete flag

3.2.3 Opportunities Table (nb_crm_opportunities)

Sales opportunity management with configurable pipeline stages.

Key fields:

FieldTypeDescription
idBIGINTPrimary key
opportunity_noVARCHAROpportunity number (auto-generated, unique)
nameVARCHAROpportunity name (required)
amountDECIMALExpected amount
currencyVARCHARCurrency
exchange_rateDECIMALExchange rate
amount_usdDECIMALUSD equivalent
customer_idBIGINTCustomer (FK)
contact_idBIGINTPrimary contact (FK)
stageVARCHARStage code (FK → stages.code)
stage_sortINTEGERStage sort order (denormalized for sorting)
stage_entered_atTIMESTAMPTime entered current stage
days_in_stageINTEGERDays in current stage
win_probabilityDECIMALManual win probability
ai_win_probabilityDECIMALAI-predicted win probability
ai_analyzed_atTIMESTAMPAI analysis timestamp
ai_confidenceDECIMALAI prediction confidence
ai_trendVARCHARAI trend: up/stable/down
ai_risk_factorsJSONBAI-identified risk factors
ai_recommendationsJSONBAI recommendation list
ai_predicted_closeDATEAI-predicted close date
ai_next_best_actionTEXTAI next best action suggestion
ai_nba_generated_atTIMESTAMPAI suggestion generated timestamp
expected_close_dateDATEExpected close date
actual_close_dateDATEActual close date
owner_idBIGINTOwner (FK → users)
last_activity_atTIMESTAMPLast activity timestamp
stagnant_daysINTEGERDays without activity
loss_reasonTEXTLoss reason
competitor_idBIGINTCompetitor (FK)
lead_sourceVARCHARLead source
campaign_idBIGINTCampaign ID
expected_revenueDECIMALExpected revenue = amount × probability
descriptionTEXTDescription

3.2.4 Quotations Table (nb_crm_quotations)

Quotation management with multi-currency and approval workflow support.

Status flow:

Draft → Pending Approval → Approved → Sent → Accepted / Rejected / Expired
              ↓
          Rejected → Revise → Draft

Key fields:

FieldTypeDescription
idBIGINTPrimary key
quotation_noVARCHARQuotation number (auto-generated, unique)
nameVARCHARQuotation name
versionINTEGERVersion number
opportunity_idBIGINTOpportunity (FK, required)
customer_idBIGINTCustomer (FK)
contact_idBIGINTContact (FK)
owner_idBIGINTOwner (FK → users)
currency_idBIGINTCurrency (FK → nb_cbo_currencies)
exchange_rateDECIMALExchange rate
subtotalDECIMALSubtotal
discount_rateDECIMALDiscount rate
discount_amountDECIMALDiscount amount
shipping_handlingDECIMALShipping & handling
tax_rateDECIMALTax rate
tax_amountDECIMALTax amount
total_amountDECIMALTotal amount
total_amount_usdDECIMALUSD equivalent
statusVARCHARStatus: draft/pending_approval/approved/sent/accepted/rejected/expired
submitted_atTIMESTAMPSubmission timestamp
approved_byBIGINTApprover (FK → users)
approved_atTIMESTAMPApproval timestamp
rejected_atTIMESTAMPRejection timestamp
sent_atTIMESTAMPSend timestamp
customer_response_atTIMESTAMPCustomer response timestamp
expired_atTIMESTAMPExpiry timestamp
valid_untilDATEValid until date
payment_termsTEXTPayment terms
terms_conditionTEXTTerms & conditions
addressTEXTShipping address
descriptionTEXTDescription

3.2.5 Orders Table (nb_crm_orders)

Order management with payment tracking.

Key fields:

FieldTypeDescription
idBIGINTPrimary key
order_noVARCHAROrder number (auto-generated, unique)
customer_idBIGINTCustomer (FK)
contact_idBIGINTContact (FK)
opportunity_idBIGINTOpportunity (FK)
quotation_idBIGINTQuotation (FK)
owner_idBIGINTOwner (FK → users)
currencyVARCHARCurrency
exchange_rateDECIMALExchange rate
order_amountDECIMALOrder amount
paid_amountDECIMALAmount paid
unpaid_amountDECIMALAmount outstanding
statusVARCHARStatus: pending/confirmed/in_progress/shipped/delivered/completed/cancelled
payment_statusVARCHARPayment status: unpaid/partial/paid
order_dateDATEOrder date
delivery_dateDATEExpected delivery date
actual_delivery_dateDATEActual delivery date
shipping_addressTEXTShipping address
logistics_companyVARCHARLogistics company
tracking_noVARCHARTracking number
terms_conditionTEXTTerms & conditions
descriptionTEXTDescription

3.3 Table Summary

CRM Business Tables

#TableDescriptionType
1nb_crm_leadsLead managementBusiness
2nb_crm_customersCustomers/companiesBusiness
3nb_crm_contactsContactsBusiness
4nb_crm_opportunitiesSales opportunitiesBusiness
5nb_crm_opportunity_stagesStage configurationConfig
6nb_crm_opportunity_usersOpportunity collaborators (sales team)Relation
7nb_crm_quotationsQuotationsBusiness
8nb_crm_quotation_itemsQuotation line itemsBusiness
9nb_crm_quotation_approvalsApproval recordsBusiness
10nb_crm_ordersOrdersBusiness
11nb_crm_order_itemsOrder line itemsBusiness
12nb_crm_paymentsPayment recordsBusiness
13nb_crm_productsProduct catalogBusiness
14nb_crm_product_categoriesProduct categoriesConfig
15nb_crm_price_tiersTiered pricingConfig
16nb_crm_activitiesActivity recordsBusiness
17nb_crm_commentsComments / notesBusiness
18nb_crm_competitorsCompetitorsBusiness
19nb_crm_tagsTagsConfig
20nb_crm_lead_tagsLead–tag relationRelation
21nb_crm_contact_tagsContact–tag relationRelation
22nb_crm_customer_sharesCustomer sharing permissionsRelation
23nb_crm_exchange_ratesExchange rate historyConfig

Base Data Tables (Shared Module)

#TableDescriptionType
1nb_cbo_currenciesCurrency dictionaryConfig
2nb_cbo_regionsCountry/region dictionaryConfig

3.4 Supporting Tables

3.4.1 Comments Table (nb_crm_comments)

General-purpose comment/note table, linkable to multiple business objects.

FieldTypeDescription
idBIGINTPrimary key
contentTEXTComment content
lead_idBIGINTRelated lead (FK)
customer_idBIGINTRelated customer (FK)
opportunity_idBIGINTRelated opportunity (FK)
order_idBIGINTRelated order (FK)

3.4.2 Customer Shares Table (nb_crm_customer_shares)

Enables multi-user collaboration and permission sharing on customers.

FieldTypeDescription
idBIGINTPrimary key
customer_idBIGINTCustomer (FK, required)
shared_with_user_idBIGINTRecipient user (FK, required)
shared_by_user_idBIGINTSharing initiator (FK)
permission_levelVARCHARPermission level: read/write/full
shared_atTIMESTAMPShare timestamp

3.4.3 Opportunity Collaborators Table (nb_crm_opportunity_users)

Supports sales team collaboration on opportunities.

FieldTypeDescription
opportunity_idBIGINTOpportunity (FK, composite PK)
user_idBIGINTUser (FK, composite PK)
roleVARCHARRole: owner/collaborator/viewer

3.4.4 Regions Table (nb_cbo_regions)

Country/region base data dictionary.

FieldTypeDescription
idBIGINTPrimary key
code_alpha2VARCHARISO 3166-1 alpha-2 code (unique)
code_alpha3VARCHARISO 3166-1 alpha-3 code (unique)
code_numericVARCHARISO 3166-1 numeric code
nameVARCHARCountry/region name
is_activeBOOLEANActive flag
sort_orderINTEGERSort order

4. Lead Lifecycle

Lead management uses a simplified 4-stage workflow. When a new lead is created, a workflow can automatically trigger AI scoring to help sales quickly identify high-quality leads.

4.1 Status Definitions

StatusNameDescription
newNewJust created, awaiting contact
workingWorkingActively being followed up
qualifiedQualifiedReady for conversion
unqualifiedUnqualifiedNot a good fit

4.2 Status Flow

4.3 Lead Conversion Flow

The conversion UI presents three options simultaneously; users can create or link:

  • Customer: Create a new customer or link to an existing one
  • Contact: Create a new contact (linked to the customer)
  • Opportunity: Must create an opportunity

Fields recorded after conversion:

  • converted_customer_id: Linked customer ID
  • converted_contact_id: Linked contact ID
  • converted_opportunity_id: Created opportunity ID

5. Opportunity Lifecycle

Opportunity management uses configurable pipeline stages. When a stage changes, a workflow can automatically trigger AI win probability prediction to help sales identify risks and opportunities.

5.1 Configurable Stages

Stages are stored in nb_crm_opportunity_stages and can be customized:

CodeNameOrderDefault Win %
prospectingProspecting110%
analysisAnalysis230%
proposalProposal360%
negotiationNegotiation480%
wonWon5100%
lostLost60%

5.2 Pipeline Flow

5.3 Stagnation Detection

Opportunities with no activity will be flagged:

Days InactiveAction
7 daysYellow warning
14 daysOrange reminder to owner
30 daysRed alert to manager
sql
-- Calculate stagnation days
UPDATE nb_crm_opportunities
SET stagnant_days = EXTRACT(DAY FROM NOW() - last_activity_at)
WHERE stage NOT IN ('won', 'lost');

5.4 Won / Lost Handling

When Won:

  1. Update stage to 'won'
  2. Record actual close date
  3. Update customer status to 'active'
  4. Trigger order creation (if quotation was accepted)

When Lost:

  1. Update stage to 'lost'
  2. Record loss reason
  3. Record competitor ID (if lost to a competitor)
  4. Notify manager

6. Quotation Lifecycle

6.1 Status Definitions

StatusNameDescription
draftDraftBeing prepared
pending_approvalPending ApprovalAwaiting approval
approvedApprovedReady to send
sentSentSent to customer
acceptedAcceptedCustomer accepted
rejectedRejectedCustomer rejected
expiredExpiredPast validity date

6.2 Approval Rules (To Be Refined)

Approval flow is triggered based on the following conditions:

ConditionApproval Level
Discount > 10%Sales Manager
Discount > 20%Sales Director
Amount > $100KFinance + CEO

6.3 Multi-Currency Support

Design Rationale

USD is used as the unified base currency for all reports and analysis. Each monetary record stores:

  • Original currency and amount (what the customer sees)
  • Exchange rate at the time of transaction
  • USD equivalent (for internal comparison)

Currency Dictionary (nb_cbo_currencies)

Currency configuration uses a shared base data table for dynamic management. The current_rate field stores the current exchange rate, synced by a scheduled task from the latest record in nb_crm_exchange_rates.

FieldTypeDescription
idBIGINTPrimary key
codeVARCHARCurrency code (unique): USD/CNY/EUR/GBP/JPY
nameVARCHARCurrency name
symbolVARCHARCurrency symbol
decimal_placesINTEGERDecimal places
current_rateDECIMALCurrent rate vs. USD (synced from exchange rate history)
is_activeBOOLEANActive flag
sort_orderINTEGERSort order

Exchange Rate History (nb_crm_exchange_rates)

Records historical exchange rate data. A scheduled task syncs the latest rate to nb_cbo_currencies.current_rate.

FieldTypeDescription
idBIGINTPrimary key
currency_codeVARCHARCurrency code (CNY/EUR/GBP/JPY)
rate_to_usdDECIMAL(10,6)Rate vs. USD
effective_dateDATEEffective date
sourceVARCHARRate source: manual/api
createdAtTIMESTAMPCreated timestamp

Note: Quotations link to nb_cbo_currencies via currency_id FK and read the rate directly from current_rate. Opportunities and orders use a currency VARCHAR field for the currency code.

Monetary Field Pattern

Tables with monetary amounts follow this pattern:

FieldTypeDescription
currencyVARCHARTransaction currency
amountDECIMALOriginal currency amount
exchange_rateDECIMALRate vs. USD at time of transaction
amount_usdDECIMALUSD equivalent (calculated)

Applied to:

  • nb_crm_opportunities.amountamount_usd
  • nb_crm_quotations.total_amounttotal_amount_usd

Workflow Integration

Exchange rate fetch logic:

  1. Business operations read rate directly from nb_cbo_currencies.current_rate
  2. USD transactions: rate = 1.0, no lookup needed
  3. current_rate is synced by scheduled task from the latest nb_crm_exchange_rates record

6.4 Version Management

When a quotation is rejected or expires, it can be copied as a new version:

QT-20260119-001 v1 → Rejected
QT-20260119-001 v2 → Sent
QT-20260119-001 v3 → Accepted

7. Order Lifecycle

7.1 Order Overview

Orders are created when a quotation is accepted, representing a confirmed business commitment.

7.2 Order Status Definitions

StatusCodeDescriptionAllowed Actions
DraftdraftCreated, not yet confirmedEdit, Confirm, Cancel
ConfirmedconfirmedConfirmed, awaiting fulfillmentStart fulfillment, Cancel
In Progressin_progressBeing processed/manufacturedUpdate progress, Ship, Cancel (approval required)
ShippedshippedProduct shipped to customerMark as Delivered
DelivereddeliveredCustomer receivedComplete order
CompletedcompletedFully completeNone
CancelledcancelledOrder cancelledNone

7.3 Order Data Model

nb_crm_orders

FieldTypeDescription
idBIGINTPrimary key
order_noVARCHAROrder number (auto-generated, unique)
customer_idBIGINTCustomer (FK)
contact_idBIGINTContact (FK)
opportunity_idBIGINTOpportunity (FK)
quotation_idBIGINTQuotation (FK)
owner_idBIGINTOwner (FK → users)
statusVARCHAROrder status
payment_statusVARCHARPayment status: unpaid/partial/paid
order_dateDATEOrder date
delivery_dateDATEExpected delivery date
actual_delivery_dateDATEActual delivery date
currencyVARCHAROrder currency
exchange_rateDECIMALRate vs. USD
order_amountDECIMALOrder total
paid_amountDECIMALAmount paid
unpaid_amountDECIMALAmount outstanding
shipping_addressTEXTShipping address
logistics_companyVARCHARLogistics company
tracking_noVARCHARTracking number
terms_conditionTEXTTerms & conditions
descriptionTEXTDescription

nb_crm_order_items

FieldTypeDescription
idBIGINTPrimary key
order_idFKParent order
product_idFKProduct reference
product_nameVARCHARProduct name snapshot
quantityINTQuantity ordered
unit_priceDECIMALUnit price
discount_percentDECIMALDiscount percentage
line_totalDECIMALLine item total
notesTEXTLine item notes

7.4 Payment Tracking

nb_crm_payments

FieldTypeDescription
idBIGINTPrimary key
order_idBIGINTRelated order (FK, required)
customer_idBIGINTCustomer (FK)
payment_noVARCHARPayment number (auto-generated, unique)
amountDECIMALPayment amount (required)
currencyVARCHARPayment currency
payment_methodVARCHARPayment method: transfer/check/cash/credit_card/lc
payment_dateDATEPayment date
bank_accountVARCHARBank account number
bank_nameVARCHARBank name
notesTEXTPayment notes

8. Customer Lifecycle

8.1 Customer Overview

Customers are created upon lead conversion or opportunity win. The system tracks the full lifecycle from acquisition to advocacy.

8.2 Customer Status Definitions

StatusCodeHealth ScoreDescription
ProspectprospectN/AConverted lead, no orders yet
Activeactive≥70Paying customer, good engagement
Growinggrowing≥80Customer with expansion opportunities
At Riskat_risk<50Showing signs of churn
ChurnedchurnedN/ANo longer active
Win Backwin_backN/AFormer customer being re-engaged
Advocateadvocate≥90High satisfaction, providing referrals

8.3 Customer Health Score

Health score is calculated from multiple factors:

FactorWeightMetric
Purchase Recency25%Days since last order
Purchase Frequency20%Orders per period
Monetary Value20%Total and average order value
Engagement15%Email open rate, meeting attendance
Support Health10%Ticket volume and resolution rate
Product Usage10%Active usage metrics (if applicable)

Health score thresholds:

javascript
if (health_score >= 90) status = 'advocate';
else if (health_score >= 70) status = 'active';
else if (health_score >= 50) status = 'growing';
else status = 'at_risk';

8.4 Customer Segmentation

Automatic Segmentation

SegmentConditionRecommended Action
VIPLifetime value > $100KWhite-glove service, executive sponsorship
EnterpriseCompany size > 500 employeesDedicated account manager
Mid-marketCompany size 50–500 employeesRegular check-ins, scaled support
StartupCompany size < 50 employeesSelf-service resources, community
Dormant90+ days inactiveRe-engagement campaign

9. Email Integration

9.1 Overview

NocoBase provides a built-in email integration plugin supporting Gmail and Outlook. Once emails are synced, workflows can automatically trigger AI analysis of email sentiment and intent, helping sales quickly understand customer attitudes.

9.2 Email Sync

Supported mailboxes:

  • Gmail (via OAuth 2.0)
  • Outlook / Microsoft 365 (via OAuth 2.0)

Sync behavior:

  • Bidirectional sync for sent and received emails
  • Automatic association to CRM records (leads, contacts, opportunities)
  • Attachments stored in the NocoBase file system

9.3 Email–CRM Association (To Be Refined)

9.4 Email Templates

Sales can use pre-built templates:

CategoryExamples
Initial OutreachCold email, warm introduction, event follow-up
Follow-upMeeting follow-up, proposal follow-up, no-reply nudge
QuotationQuote attached, quote revised, quote expiring soon
OrderOrder confirmation, shipping notification, delivery confirmation
Customer SuccessWelcome, check-in, review request

10. AI Capabilities

10.1 AI Employee Team

The CRM integrates the NocoBase AI plugin, using the following built-in AI employees with CRM-specific tasks configured:

IDNameBuilt-in RoleCRM Extended Capabilities
vizVizData AnalystSales data analysis, pipeline forecasting
daraDaraChart ExpertData visualization, report charts, dashboard design
ellisEllisEditorEmail reply drafting, communication summaries, business email composition
lexiLexiTranslatorMultilingual customer communication, content translation
orinOrinOrganizerDaily priorities, next-best-action suggestions, follow-up planning

10.2 AI Task List

AI capabilities are divided into two independent categories:

1. AI Employees (Frontend — User-Triggered)

Users interact directly with AI employees via frontend blocks to get analysis and recommendations.

EmployeeTaskDescription
VizSales Data AnalysisAnalyze pipeline trends and conversion rates
VizPipeline ForecastRevenue forecast based on weighted pipeline
DaraChart GenerationGenerate sales report charts
DaraDashboard DesignDesign data dashboard layouts
EllisReply DraftingGenerate professional email replies
EllisCommunication SummarySummarize email threads
EllisBusiness Email CompositionDraft meeting invitations, follow-ups, thank-you emails
OrinDaily PrioritiesGenerate today's prioritized task list
OrinNext Best ActionRecommend next steps for each opportunity
LexiContent TranslationTranslate marketing materials, proposals, emails

2. Workflow LLM Nodes (Backend — Auto-Executed)

LLM nodes embedded in workflows, triggered automatically via table events, action events, or scheduled tasks — independent of AI employees.

TaskTriggerDescriptionFields Written
Lead ScoringTable event (create/update)Evaluate lead qualityai_score, ai_convert_prob
Win ProbabilityTable event (stage change)Predict opportunity successai_win_probability, ai_risk_factors

Note: Workflow LLM nodes use prompts with schema-defined output to produce structured JSON, which is then parsed and written to business data fields — no user interaction required.

10.3 AI Fields in the Database

TableAI FieldDescription
nb_crm_leadsai_scoreAI score 0–100
ai_convert_probConversion probability
ai_best_contact_timeAI-recommended contact time
ai_tagsAI-generated tags (JSONB)
ai_scored_atScoring timestamp
ai_next_best_actionNext best action suggestion
ai_nba_generated_atSuggestion generated timestamp
nb_crm_opportunitiesai_win_probabilityAI-predicted win probability
ai_analyzed_atAnalysis timestamp
ai_confidencePrediction confidence
ai_trendTrend: up/stable/down
ai_risk_factorsRisk factors (JSONB)
ai_recommendationsRecommendation list (JSONB)
ai_predicted_closePredicted close date
ai_next_best_actionNext best action suggestion
ai_nba_generated_atSuggestion generated timestamp
nb_crm_customersai_health_scoreHealth score 0–100
ai_health_gradeHealth grade: A/B/C/D
ai_churn_riskChurn risk 0–100%
ai_churn_risk_levelChurn risk level: low/medium/high
ai_health_dimensionsDimension scores (JSONB)
ai_recommendationsRecommendation list (JSONB)
ai_health_assessed_atHealth assessment timestamp
ai_tagsAI-generated tags (JSONB)
ai_best_contact_timeAI-recommended contact time
ai_next_best_actionNext best action suggestion
ai_nba_generated_atSuggestion generated timestamp

11. Workflow Engine

11.1 Implemented Workflows

Workflow NameTrigger TypeStatusDescription
Leads CreatedTable eventEnabledTriggered when a lead is created
CRM Overall AnalyticsAI employee eventEnabledCRM-wide data analysis
Lead ConversionPost-action eventEnabledLead conversion flow
Lead AssignmentTable eventEnabledAutomatic lead assignment
Lead ScoringTable eventDisabledLead scoring (pending refinement)
Follow-up ReminderScheduled taskDisabledFollow-up reminders (pending refinement)

11.2 Planned Workflows

WorkflowTrigger TypeDescription
Opportunity Stage AdvanceTable eventUpdate win probability and record timestamp on stage change
Stagnation DetectionScheduled taskDetect inactive opportunities and send reminders
Quotation ApprovalPost-action eventMulti-level approval flow
Order GenerationPost-action eventAuto-create order when quotation is accepted

12. Menu & Interface Design

12.1 Admin Menu Structure

MenuTypeDescription
DashboardsGroupDashboards
- DashboardPageDefault dashboard
- SalesManagerPageSales manager view
- SalesRepPageSales rep view
- ExecutivePageExecutive view
LeadsPageLead management
CustomersPageCustomer management
OpportunitiesPageOpportunity management
- TableTabOpportunity list
ProductsPageProduct management
- CategoriesTabProduct categories
OrdersPageOrder management
SettingsGroupSettings
- Stage SettingsPageOpportunity stage configuration
- Exchange RatePageExchange rate settings
- ActivityPageActivity records
- EmailsPageEmail management
- ContactsPageContact management
- Data AnalysisPageData analysis

12.2 Dashboard Views

Sales Manager View

ComponentTypeData
Pipeline ValueKPI CardTotal pipeline value by stage
Team LeaderboardTableRep performance ranking
Risk AlertsAlert ListHigh-risk opportunities
Win Rate TrendLine ChartMonthly win rate
Stagnant DealsListDeals needing attention

Sales Rep View

ComponentTypeData
My Quota ProgressProgress BarMonthly actual vs. quota
Open OpportunitiesKPI CardMy open opportunity count
Closing This WeekListDeals closing soon
Overdue ActivitiesAlertOverdue tasks
Quick ActionsButtonsLog activity, Create opportunity

Executive View

ComponentTypeData
Annual RevenueKPI CardYear-to-date revenue
Pipeline ValueKPI CardTotal pipeline
Win RateKPI CardOverall win rate
Customer HealthDistribution ChartHealth score distribution
ForecastChartMonthly revenue forecast

Document Version: v2.0 | Last Updated: 2026-02-06