Fionn

AI-Powered Renewal Management System — Architecture Document

1. System Overview

Fionn is an AI-based software renewal management system that automates the end-to-end renewal lifecycle — from initial customer outreach through final contract closure. It operates across multiple integrated platforms to identify upcoming renewals, engage customers via intelligent email conversations, track renewal stages, and provide real-time operational visibility through a management dashboard.

Fionn replaces manual renewal management with an autonomous AI agent that handles outreach, follow-ups, sentiment analysis, pricing, quoting, and stage progression — all while maintaining strict communication discipline and contract rules.

Core Principles

2. High-Level Architecture

graph TB
    subgraph Fionn System
        SF["Salesforce<br/>(Trilogy Sales + No Software Speed)"]
        CC["CuChulainn<br/>AI Engine<br/>4 Packages · 14 Skills · 1 Agent"]
        DASH["Fionn Dashboard<br/>Frontend · Backend · Storage"]
    end

    subgraph External Systems
        KLAIR["Klair<br/>NetSuite Data"]
        KAYAKO["Kayako<br/>Support Tickets"]
        OPENAI["OpenAI<br/>GPT-5.3-instant"]
        GAS["Google Apps Script<br/>Email Routing"]
    end

    SF <--> CC
    CC <--> DASH
    SF <--> DASH
    CC --> KLAIR
    CC --> KAYAKO
    CC --> OPENAI
    GAS --> CC
    OPENAI --> DASH
    CUSTOMER["Customer<br/>Email Inbox"] <--> GAS
    CC --> CUSTOMER
            

3. Component Architecture

3.1 CuChulainn — AI Execution Engine

CuChulainn is the core AI platform that powers Fionn's autonomous operations. It provides the runtime for AI packages, each containing workflows, skills, and agents.

graph LR
    subgraph CuChulainn Platform
        GO["GeneralOutbound<br/>First contact with customer"]
        GI["GeneralInbound<br/>Reply to every inbound email"]
        RP["ReminderPackage<br/>Follow-up + find more users"]
        EI["EmailInvestigator<br/>Find alternate emails"]
        SA["SalesforceAgent<br/>6 Salesforce skills"]
        SK["14 Shared Skills<br/>API endpoints"]
    end

    GO --> SK
    GI --> SK
    RP --> SK
    EI --> SK
    GO --> SA
    GI --> SA
    RP --> SA
    EI --> SA
            

3.2 Fionn Dashboard — Operational Visibility Layer

The dashboard provides real-time pipeline visibility, AI health assessments, and operational controls.

ComponentTechnologyPurpose
FrontendS3 + CloudFrontStatic HTML/JS/CSS dashboard
API BackendAWS Lambda (fionn-dashboard-api)REST API for dashboard operations
Sync EngineAWS Lambda (fionn-dashboard-sync)Daily Salesforce data sync + AI refresh
Auto-TriggerAWS Lambda (fionn-auto-trigger)Scheduled outbound triggers + smart reminders
Primary StoreDynamoDB (FionnDashboard)Opportunity data, AI status, flags, notes, defer state
Email LogsDynamoDB (FionnEmailLogs)Email conversation history
Product ConfigDynamoDB (FionnProductConfig)Product-to-project mappings and aliases
CDNCloudFront (E22HOIROU34E4P)Global content delivery + API routing
API GatewayHTTP API (o61t89e1x1)REST endpoint routing

3.3 Scheduled Processes

Three scheduled processes run via AWS EventBridge:

ScheduleLambdaCronPurpose
Daily Syncfionn-dashboard-synccron(0 6 * * ? *) (6 AM UTC)Salesforce data sync + AI status refresh
Auto-Triggerfionn-auto-triggercron(0 14 * * ? *) (2 PM GMT)Auto-trigger Fionn at ≤180 days, auto-reminders for stale Pending opps

4. CuChulainn Packages — Detailed Flows

4.1 GeneralOutbound

Purpose: First contact with the customer when a renewal is approaching.
Trigger: Dashboard trigger (manual or auto-trigger at ≤180 days to renewal).
Package ID: PACKAGE-d3a9354c-3d3e-4edd-9494-c55898403852 (common for all products)

flowchart LR
    T["Trigger<br/>(Manual or Auto)"] --> FETCH["Fetch Opportunity<br/>from Salesforce"]
    FETCH --> KLAIR["Get NetSuite<br/>Contract Data"]
    KLAIR --> COMPOSE["AI Composes<br/>Outreach Email"]
    COMPOSE --> SEND["Send Email<br/>to Customer"]
    SEND --> LOG["Log to<br/>FionnEmailLogs"]
    LOG --> UPDATE["Update Opp Stage<br/>→ Outreach"]
            

Key behaviors

4.2 GeneralInbound

Purpose: Process and respond to every inbound customer email related to a renewal.
Trigger: Google Apps Script routes inbound email to CuChulainn.

flowchart LR
    IN["Inbound Email<br/>via Apps Script"] --> PARSE["Parse Email<br/>+ Thread Context"]
    PARSE --> ANALYZE["AI Sentiment<br/>Analysis"]
    ANALYZE --> DECIDE["Determine<br/>Response Strategy"]
    DECIDE --> REPLY["AI Composes<br/>Reply"]
    REPLY --> SEND["Send Reply<br/>to Customer"]
    SEND --> STAGE["Update Stage<br/>if Needed"]
            

Key behaviors

4.3 ReminderPackage

Purpose: Follow up when no customer response has been received. Discovers and adds additional contacts to widen the outreach net.
Trigger: Auto-trigger (daily at 2 PM GMT for Pending opps with no reply in 5+ days) or manual dashboard trigger.
Package ID: PACKAGE-9dc9897a-3d92-4dc1-b7c6-ddd3591a74e8

flowchart LR
    CHECK["Check Last<br/>Mail Date"] --> DEFER{"Defer Signal<br/>Detected?"}
    DEFER -->|Yes| PAUSE["Pause Until<br/>Follow-up Date"]
    DEFER -->|No| CONTACTS["Find Additional<br/>Contacts"]
    CONTACTS --> COMPOSE["AI Composes<br/>Follow-up"]
    COMPOSE --> SEND["Send Reminder<br/>Email"]
    SEND --> LOG["Log + Update<br/>Reminder Count"]
            

Key Differentiator: Actively searches for additional contacts beyond Salesforce, broadening reach when the original contact is unresponsive.

4.4 EmailInvestigator

Purpose: Find alternate email addresses when delivery fails or the primary contact is unreachable.
Trigger: Called by other packages when email bounces or no response after multiple reminders.

flowchart LR
    BOUNCE["Delivery Failure<br/>or No Response"] --> SEARCH["Search Kayako<br/>+ Other Systems"]
    SEARCH --> VALIDATE["Validate Found<br/>Addresses"]
    VALIDATE --> UPDATE["Update Contact<br/>in Salesforce"]
    UPDATE --> RETRY["Retry Outreach<br/>with New Address"]
            

5. Automated Trigger & Reminder System

The system runs autonomously at 2:00 PM GMT daily via the fionn-auto-trigger Lambda.

5.1 Auto-Trigger Rules

RuleConditionAction
Auto-Trigger Outbound≤180 days to renewal AND not yet triggered AND not closed/finalizingCalls Fionn outbound API, marks FionnTriggered = Yes, AutoTriggered = true
Auto-Send ReminderStage is "Pending" AND already triggered AND last mail direction is outbound AND 5+ days since last mailAnalyzes emails for defer → if no defer, sends reminder

5.2 Smart Defer Detection

Before sending any auto-reminder, the system analyzes the last 5 emails using GPT-5.3-instant to detect defer signals from the customer.

Detected signals include

When a defer is detected

  1. GPT extracts the follow-up date (converts relative dates like "in 2 weeks" to actual dates)
  2. ReminderPausedUntil is stored in DynamoDB with the extracted date
  3. DeferReason captures the customer's statement
  4. Reminders are suppressed until the follow-up date
  5. When the date arrives, reminders automatically resume
flowchart TB
    AUTO["Auto-Trigger<br/>2 PM GMT Daily"] --> SCAN["Scan All<br/>Open Opportunities"]
    SCAN --> TRIGGER{"≤180 Days<br/>& Not Triggered?"}
    TRIGGER -->|Yes| OUTBOUND["Call Fionn<br/>Outbound API"]
    TRIGGER -->|No| PENDING{"Pending Stage<br/>& 5+ Days Stale?"}
    PENDING -->|Yes| PAUSED{"Reminder<br/>Paused?"}
    PAUSED -->|Yes, Future| SKIP["Skip — Wait for<br/>Follow-up Date"]
    PAUSED -->|No or Expired| ANALYZE["AI Analyzes<br/>Recent Emails"]
    ANALYZE --> DEFER{"Defer Signal<br/>Found?"}
    DEFER -->|Yes| STORE["Store Pause Date<br/>+ Reason"]
    DEFER -->|No| REMIND["Send Reminder<br/>via ReminderPackage"]
    PENDING -->|No| NEXT["Next Opportunity"]
            

5.3 Manual Pause/Resume

The dashboard provides manual controls to pause or resume reminders:

6. Skills Reference

All skills are shared across packages. Each skill is an API endpoint performing one atomic task.

#Skill NameDescription
1send_email_fionnSend email from Fionn mailbox to customer
2get_sf_detailsGet full opportunity details from Salesforce
3update_sf_stageUpdate opportunity stage in Salesforce
4get_klair_contractFetch NetSuite contract data via Klair
5get_klair_pricingFetch pricing and subscription details
6search_kayako_ticketsSearch Kayako for support history
7get_kayako_contactsFind alternate contacts from Kayako
8pull_andon_cord_fionnEmergency stop — halts all processing
9get_sf_contact_rolesGet contact roles for an opportunity
10update_sf_contactUpdate contact information in Salesforce
11search_sf_accountsSearch Salesforce accounts by criteria
12get_email_threadRetrieve full email thread history
13validate_emailValidate email address deliverability
14log_activityLog activity to FionnEmailLogs DynamoDB table

7. Agents Reference

AgentSkills UsedPurpose
SalesforceAgentget_sf_details, update_sf_stage, get_sf_contact_roles, update_sf_contact, search_sf_accounts, log_activityManages all Salesforce interactions with AI intelligence to decide which data to fetch/update

8. Renewal Pipeline — Stage Progression

The renewal lifecycle follows a strict sequential pipeline. Fionn manages transitions automatically based on conversation state.

flowchart LR
    P["Pending"] --> O["Outreach"]
    O --> E["Engaged"]
    E --> PR["Proposal"]
    PR --> QF["Quote Follow Up"]
    QF --> F["Finalizing"]
    F --> CW["Closed Won"]
    F --> CL["Closed Lost"]
            

Stage Definitions

StageMeaningTypical Timeline
PendingRenewal identified, no outreach yet>180 days
OutreachInitial email sent, awaiting response180–145 days
EngagedCustomer is actively responding145–90 days
ProposalQuote or proposal shared90–60 days
Quote Follow UpAwaiting customer decision on quote60–30 days
FinalizingContract in final closing stage (treated as closed)30–0 days
Closed WonRenewal completed successfully
Closed LostCustomer chose not to renew

Stage Treatment

9. Data Flow — End to End

graph TB
    subgraph External Data Sources
        SF_TS["Salesforce: Trilogy Sales<br/>Fionn AI owned opportunities"]
        SF_NS["Salesforce: No Software Speed<br/>Renewal data · ARR · Stages"]
    end

    subgraph AI Services
        OAI["OpenAI GPT-5.3-instant<br/>AI status · Summaries · Defer analysis"]
    end

    subgraph Fionn Core
        CC["CuChulainn<br/>4 Packages"]
        LAMBDA_SYNC["Lambda: Sync<br/>Daily 6 AM UTC"]
        LAMBDA_API["Lambda: API<br/>Dashboard backend"]
        LAMBDA_AUTO["Lambda: Auto-Trigger<br/>Daily 2 PM GMT"]
        DDB["DynamoDB<br/>Opportunities · Emails · Config"]
        DASH["Dashboard UI<br/>S3 + CloudFront"]
    end

    SF_TS --> LAMBDA_SYNC
    SF_NS --> LAMBDA_SYNC
    LAMBDA_SYNC --> DDB
    LAMBDA_SYNC --> OAI
    DDB --> DASH
    DASH --> LAMBDA_API
    LAMBDA_API --> CC
    LAMBDA_AUTO --> CC
    LAMBDA_AUTO --> OAI
    LAMBDA_AUTO --> DDB
            

Data Sync Process (Daily + On-Demand)

  1. Trilogy Sales query — Fetch all Fionn AI-owned opportunity IDs via SOAP API
  2. No Software Speed query — Fetch renewal data (ARR, stage, dates) for those IDs via REST API
  3. Email log merge — Fetch from FionnEmailLogs DynamoDB + legacy mail tracking API
  4. Safe upsert — Write to DynamoDB preserving protected fields (triggers, reminders, flags, notes, AI status, defer state)
  5. Stale cleanup — Remove records no longer in Salesforce
  6. AI refresh — Generate/update AI health status for all open opportunities
  7. DaysSinceLastMail — Recalculated in real-time on every API response (not stored stale)

10. Dashboard Features

10.1 Hierarchical Table View

Opportunities are organized in a collapsible hierarchy:

▶ Business Unit (e.g., JigTree) ▶ Product (e.g., Tivian) Customer A — $50,000 ARR — 45 days — Engaged — 🟢 On Track Customer B — $12,000 ARR — 120 days — Outreach — 🟡 Attention

All groups are collapsed by default. Expand All / Collapse All toggle is available. A second "Flat View" tab shows all opportunities without grouping.

10.2 Per-Opportunity AI Status

Each opportunity has an AI-generated health assessment powered by GPT-5.3-instant:

SignalMeaningCriteria
🟢 GREENOn TrackStage matches or ahead of timeline, active communication
🟡 YELLOWAttentionStage slightly behind, or communication stalled >14 days
🔴 REDAt RiskStage significantly behind, no outreach when overdue, or customer expressed intent to cancel

AI status is refreshed:

10.3 AI Status Click-to-Expand

Clicking an AI signal expands an inline detail panel below that opportunity showing:

10.4 Smart Reminder Controls

Each opportunity's reminder column shows contextual controls:

10.5 KPI Cards & Running Totals

MetricDescription
Urgent (<30d)Open opportunities within 30 days of renewal
Upcoming (30-90d)Open opportunities 30-90 days from renewal
Fionn TriggeredTotal opportunities with outbound initiated
Emails SentTotal email count across all opportunities
DeferredOpportunities with paused reminders (AI or manual)
Running ARRDynamic ARR total in toolbar, updates with filters

10.6 Additional Features

11. Integration Map

graph TB
    subgraph External Data Sources
        SF_TS["Salesforce: Trilogy Sales<br/>Fionn AI owned opportunities"]
        SF_NS["Salesforce: No Software Speed<br/>Renewal data · ARR · Stages"]
        KLAIR["Klair<br/>NetSuite contract data · Pricing"]
        KAYAKO["Kayako<br/>Support tickets · Alternate contacts"]
    end

    subgraph AI Services
        OAI_CC["OpenAI GPT-4o<br/>CuChulainn email generation<br/>Sentiment analysis"]
        OAI_DASH["OpenAI GPT-5.3-instant<br/>Dashboard AI status<br/>Executive summaries<br/>Defer detection"]
    end

    subgraph Fionn Core
        CC["CuChulainn<br/>4 Packages"]
        LAMBDA["AWS Lambda<br/>API + Sync + Auto-Trigger"]
        DDB["DynamoDB<br/>3 Tables"]
        DASH["Dashboard UI<br/>S3 + CloudFront"]
    end

    subgraph Communication
        GAS["Google Apps Script<br/>Email processing + routing"]
        CUST["Customer<br/>Email inbox"]
    end

    SF_TS --> LAMBDA
    SF_NS --> LAMBDA
    LAMBDA --> DDB
    DDB --> DASH
    LAMBDA --> OAI_DASH

    CC --> KLAIR
    CC --> KAYAKO
    CC --> OAI_CC
    CC --> SF_NS

    DASH --> LAMBDA
    LAMBDA --> CC

    GAS --> CC
    CC --> CUST
    CUST --> GAS
            

12. Security Architecture

LayerMeasure
API KeysStored as Lambda environment variables, never in frontend code
CORSOrigin whitelist (CloudFront domain + localhost dev) — no wildcard
Input ValidationSalesforce ID regex validation (^[a-zA-Z0-9]{15,18}$) on all ID parameters
XSS ProtectionAll user-supplied content escaped via escapeHtml() before DOM insertion
Email SanitizationHTML emails sanitized via DOMParser — scripts, iframes, forms stripped; event handlers removed; external images blocked (tracking pixel protection)
CDN IntegritySRI attributes on external script tags (jsPDF, AutoTable)
Sensitive LoggingRequest logging excludes full event payload — only method + path logged
DynamoDBProtected fields preserved during sync (triggers, flags, notes, AI, defer state never overwritten)

13. Communication Guardrails

Fionn operates under strict communication rules enforced at the package level:

Forbidden in All Outbound Communication

Required in All Communication

Contract Rules

14. Deployment Architecture

flowchart LR
    DEV["Developer<br/>Machine"] --> FE["S3 Upload<br/>index.html · app.js<br/>styles.css · logo.png<br/>architecture.html"]
    DEV --> BE["Lambda Deploy<br/>lambda_handler.py<br/>→ API + Sync + Auto-Trigger"]
    DEV --> RT["API Gateway<br/>Route creation"]
    DEV --> EB["EventBridge<br/>Schedule rules"]
    FE --> CF["CloudFront<br/>Cache Invalidation"]
    CF --> LIVE["Live Dashboard"]

    style LIVE fill:#EDFAF3,stroke:#1A7F4B,color:#1A1A18
            
ItemValue
AWS Account582049328161
Regionus-east-1
S3 Bucketfionn-dashboard-frontend-582049328161
CloudFront DistributionE22HOIROU34E4P
API Lambdafionn-dashboard-api
Sync Lambdafionn-dashboard-sync
Auto-Trigger Lambdafionn-auto-trigger
API Gatewayo61t89e1x1 (HTTP API)
DynamoDB TablesFionnDashboard, FionnEmailLogs, FionnProductConfig
Daily Sync Schedulecron(0 6 * * ? *) — 6:00 AM UTC
Auto-Trigger Schedulecron(0 14 * * ? *) — 2:00 PM GMT
AI ModelGPT-5.3-instant (via OpenAI API)

15. Product Portfolio

Products are organized by Business Unit. Each product has an Ephor Project ID for CuChulainn integration and may have Salesforce name aliases for normalization.

Business UnitProducts
JigTreeTivian, BroadVision, Influitive, MessageOne, Artemis, Bonzai, ACRM, Pivotal, Aurea Platform, Stratifyd, Playbooks, Saratoga, Jigsaw Platform, Onyx, CRMagic, Engine Yard, CallStream
IgniteTechDNN, NorthPlains, Jive, Tradebeam, Verdiem, Gensym, Everest, ObjectStore, Autotrol, StreetSmart, Gomembers, Infobright, TAKE, Coretrac, Nuview, AnswerHub, Smart Routines, Acorn, Computron, Prysm, SupportSoft, Aurea Social, EPM Live, Myalerts, ScaleArc, AtHand, Prologic, Knova, Pricer, NextDocs, Config, Fog Bugz, Eloquens, Sococo, Olive Software, Suuchi, School Loop
SkyveraNewNet, STL, Mobilogy, Service Gateway, ResponseTek, VoltDelta, Cloudsense, Kandy, PeerApp
CanopyContently, Kayako, CloudFix
Aurea E-CommerceAurea SAS, SLI, Spiral, Quantum Retail, Finserv(AIS)
Ignite SMBKerio, GFI, Exinda