Skip to content

Agentic Workflow Opportunities Analysis

Executive Summary

This analysis identifies database schema enhancements to enable agentic AI workflows that support the partner GTM journey: PRE-LIST → LAUNCH → POST-LAUNCH → SCALE → CO-SELL

Opportunities are prioritized by GTM value impact: - CRITICAL: Directly enables partner conversion and revenue - HIGH: Significantly improves GTM workflow efficiency - MEDIUM: Enhances user experience and workflow intelligence - LOW: Nice-to-have improvements


CRITICAL Priority Opportunities

1. companies Table - Add Partner Journey Tracking

Current State: Has gtm_goals JSON but no journey stage tracking.

Recommended Additions:

ALTER TABLE companies ADD COLUMN partner_journey_stage ENUM(
    'discovery', 'pre_list', 'launch', 'post_launch', 'scale', 'co_sell'
) DEFAULT 'discovery';
ALTER TABLE companies ADD COLUMN journey_started_at TIMESTAMP NULL;
ALTER TABLE companies ADD COLUMN journey_milestones JSON NULL; -- {stage: completed_at}
ALTER TABLE companies ADD COLUMN next_recommended_actions JSON NULL; -- AI-populated
ALTER TABLE companies ADD COLUMN blockers JSON NULL; -- Current blockers per stage
ALTER TABLE companies ADD COLUMN partner_tier ENUM('standard', 'select', 'advanced', 'premier') NULL;
ALTER TABLE companies ADD COLUMN aws_partner_id VARCHAR(100) NULL;

Agentic Value: - Agents can check company journey stage before suggesting templates - Auto-populate context_requirements for MDF applications - Trigger stage-appropriate content recommendations


2. products Table - Add Launch Readiness & Marketplace Status

Current State: Has basic marketplace_type but lacks launch readiness integration.

Recommended Additions:

ALTER TABLE products ADD COLUMN launch_status ENUM(
    'ideation', 'development', 'pre_launch', 'soft_launch',
    'ga', 'growth', 'mature', 'sunset'
) DEFAULT 'ideation';
ALTER TABLE products ADD COLUMN launch_readiness_score INT DEFAULT 0; -- Cached from reports
ALTER TABLE products ADD COLUMN last_compliance_check_at TIMESTAMP NULL;
ALTER TABLE products ADD COLUMN blocking_issues_count INT DEFAULT 0;
ALTER TABLE products ADD COLUMN aws_product_code VARCHAR(100) NULL;
ALTER TABLE products ADD COLUMN listing_live_date DATE NULL;
ALTER TABLE products ADD COLUMN target_launch_date DATE NULL;
ALTER TABLE products ADD COLUMN prerequisite_tasks JSON NULL; -- [{task, status, due_date}]

Agentic Value: - Templates can auto-suggest based on product launch status - Block certain workflows until prerequisites are met - Auto-trigger compliance checks when approaching launch


3. NEW TABLE: partner_journey_events - Journey Audit Trail

Why Needed: No current way to track journey progression for agents to learn from.

CREATE TABLE partner_journey_events (
    id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    company_id BIGINT UNSIGNED NOT NULL,
    product_id BIGINT UNSIGNED NULL,
    user_id BIGINT UNSIGNED NOT NULL,

    -- Event details
    event_type ENUM(
        'stage_transition', 'milestone_achieved', 'blocker_added',
        'blocker_resolved', 'content_generated', 'compliance_check',
        'mdf_submitted', 'mdf_approved', 'listing_published',
        'first_customer', 'co_sell_initiated', 'deal_registered'
    ) NOT NULL,

    from_stage VARCHAR(50) NULL,
    to_stage VARCHAR(50) NULL,

    -- Context
    related_entity_type VARCHAR(100) NULL, -- user_openai, compliance_report, etc.
    related_entity_id BIGINT UNSIGNED NULL,

    -- Metadata
    event_data JSON NULL, -- Event-specific data
    triggered_by ENUM('user', 'agent', 'system', 'webhook') DEFAULT 'user',
    agent_id VARCHAR(100) NULL, -- Which agent triggered this

    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,

    FOREIGN KEY (company_id) REFERENCES companies(id) ON DELETE CASCADE,
    FOREIGN KEY (product_id) REFERENCES products(id) ON DELETE SET NULL,
    FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,

    INDEX idx_company_events (company_id, event_type, created_at),
    INDEX idx_journey_progression (company_id, from_stage, to_stage)
);

Agentic Value: - Agents can query journey history to suggest next steps - Identify patterns in successful partner journeys - Trigger automated workflows based on events


4. user_openai Table - Connect Content to GTM Journey

Current State: Stores generated content but no GTM context.

Recommended Additions:

ALTER TABLE user_openai ADD COLUMN company_id BIGINT UNSIGNED NULL;
ALTER TABLE user_openai ADD COLUMN product_id BIGINT UNSIGNED NULL;
ALTER TABLE user_openai ADD COLUMN journey_stage VARCHAR(50) NULL;
ALTER TABLE user_openai ADD COLUMN content_purpose ENUM(
    'listing_content', 'mdf_application', 'co_sell_materials',
    'customer_facing', 'internal_planning', 'compliance', 'other'
) NULL;
ALTER TABLE user_openai ADD COLUMN workflow_chain_id VARCHAR(100) NULL; -- Groups related generations
ALTER TABLE user_openai ADD COLUMN parent_generation_id BIGINT UNSIGNED NULL; -- For iterative workflows
ALTER TABLE user_openai ADD COLUMN quality_score DECIMAL(5,2) NULL; -- AI self-assessment
ALTER TABLE user_openai ADD COLUMN used_in_submission BOOLEAN DEFAULT FALSE; -- Track if used in MDF/listing

ALTER TABLE user_openai ADD FOREIGN KEY (company_id) REFERENCES companies(id) ON DELETE SET NULL;
ALTER TABLE user_openai ADD FOREIGN KEY (product_id) REFERENCES products(id) ON DELETE SET NULL;

Agentic Value: - Link generated content to specific products/companies - Track content lineage for iterative refinement - Measure content usage in actual submissions


HIGH Priority Opportunities

5. NEW TABLE: workflow_chains - Multi-Step Workflow Orchestration

CREATE TABLE workflow_chains (
    id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    chain_id VARCHAR(100) UNIQUE NOT NULL, -- UUID
    user_id BIGINT UNSIGNED NOT NULL,
    company_id BIGINT UNSIGNED NULL,
    product_id BIGINT UNSIGNED NULL,

    -- Chain definition
    name VARCHAR(255) NOT NULL,
    chain_type ENUM(
        'mdf_application', 'listing_creation', 'co_sell_prep',
        'content_campaign', 'compliance_remediation', 'custom'
    ) NOT NULL,

    -- Progress
    status ENUM('draft', 'in_progress', 'paused', 'completed', 'failed') DEFAULT 'draft',
    current_step INT DEFAULT 0,
    total_steps INT NOT NULL,
    steps_config JSON NOT NULL, -- [{step_num, template_slug, required, status, output_id}]

    -- Accumulated context
    chain_context JSON NULL, -- Aggregated outputs for downstream steps

    -- Timing
    started_at TIMESTAMP NULL,
    completed_at TIMESTAMP NULL,
    estimated_completion TIMESTAMP NULL,

    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

    FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
    FOREIGN KEY (company_id) REFERENCES companies(id) ON DELETE SET NULL,
    FOREIGN KEY (product_id) REFERENCES products(id) ON DELETE SET NULL,

    INDEX idx_user_chains (user_id, status, chain_type),
    INDEX idx_company_chains (company_id, chain_type)
);

Agentic Value: - Define multi-step workflows (e.g., "MDF Application Bundle") - Pass context between steps automatically - Track completion and resume interrupted workflows


6. demo_requestspartner_leads Enhancement

Current State: Good for demo tracking but limited for partner conversion.

Recommended Additions:

ALTER TABLE demo_requests ADD COLUMN lead_score INT DEFAULT 0;
ALTER TABLE demo_requests ADD COLUMN lead_signals JSON NULL; -- {signal_type: value}
ALTER TABLE demo_requests ADD COLUMN recommended_plan_id BIGINT UNSIGNED NULL;
ALTER TABLE demo_requests ADD COLUMN recommended_templates JSON NULL; -- AI-suggested onboarding
ALTER TABLE demo_requests ADD COLUMN partner_potential ENUM('low', 'medium', 'high', 'enterprise') NULL;
ALTER TABLE demo_requests ADD COLUMN estimated_arr DECIMAL(12,2) NULL;
ALTER TABLE demo_requests ADD COLUMN journey_started BOOLEAN DEFAULT FALSE;

Agentic Value: - Agents can personalize onboarding based on lead signals - Auto-suggest appropriate plan based on company characteristics - Predict partner potential for prioritization


7. compliance_reports - Add Remediation Workflow

Current State: Good for reporting but lacks remediation tracking.

Recommended Additions:

ALTER TABLE compliance_reports ADD COLUMN remediation_chain_id VARCHAR(100) NULL;
ALTER TABLE compliance_reports ADD COLUMN auto_fix_attempted BOOLEAN DEFAULT FALSE;
ALTER TABLE compliance_reports ADD COLUMN auto_fix_results JSON NULL;
ALTER TABLE compliance_reports ADD COLUMN next_check_scheduled_at TIMESTAMP NULL;
ALTER TABLE compliance_reports ADD COLUMN assigned_to BIGINT UNSIGNED NULL; -- For manual fixes

ALTER TABLE compliance_report_items ADD COLUMN remediation_template_slug VARCHAR(255) NULL;
ALTER TABLE compliance_report_items ADD COLUMN remediation_generation_id BIGINT UNSIGNED NULL;

Agentic Value: - Auto-trigger content generation to fix compliance issues - Link fixes to specific compliance items - Schedule follow-up checks after remediation


MEDIUM Priority Opportunities

8. NEW TABLE: agent_sessions - Track Agent Interactions

CREATE TABLE agent_sessions (
    id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    session_id VARCHAR(100) UNIQUE NOT NULL,
    user_id BIGINT UNSIGNED NOT NULL,

    -- Context
    company_id BIGINT UNSIGNED NULL,
    product_id BIGINT UNSIGNED NULL,
    journey_stage VARCHAR(50) NULL,

    -- Agent info
    agent_type ENUM(
        'content_strategist', 'visual_creator', 'content_optimizer',
        'market_analyst', 'technical_builder', 'solution_advisor',
        'mdf_assistant', 'co_sell_advisor'
    ) NOT NULL,

    -- Session data
    status ENUM('active', 'paused', 'completed', 'abandoned') DEFAULT 'active',
    messages_count INT DEFAULT 0,
    tokens_used INT DEFAULT 0,

    -- Learning
    user_satisfaction TINYINT NULL, -- 1-5 rating
    successful_outcome BOOLEAN NULL,
    outcome_type VARCHAR(100) NULL, -- What was achieved

    -- Context passing
    session_context JSON NULL, -- Accumulated context
    handoff_to_agent VARCHAR(100) NULL, -- If session handed off

    started_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    ended_at TIMESTAMP NULL,

    FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,

    INDEX idx_user_sessions (user_id, agent_type, status),
    INDEX idx_journey_sessions (journey_stage, agent_type)
);

Agentic Value: - Track which agents are most effective at each journey stage - Enable warm handoffs between agents with context - Learn from successful outcomes


9. marketplace_entitlements - Add Upsell Intelligence

Current State: Good for tracking entitlements but lacks upsell signals.

Recommended Additions:

ALTER TABLE marketplace_entitlements ADD COLUMN usage_trend ENUM('declining', 'stable', 'growing', 'spiking') NULL;
ALTER TABLE marketplace_entitlements ADD COLUMN upsell_signals JSON NULL; -- {signal: score}
ALTER TABLE marketplace_entitlements ADD COLUMN recommended_upgrade VARCHAR(100) NULL;
ALTER TABLE marketplace_entitlements ADD COLUMN churn_risk ENUM('low', 'medium', 'high') NULL;
ALTER TABLE marketplace_entitlements ADD COLUMN last_engagement_at TIMESTAMP NULL;
ALTER TABLE marketplace_entitlements ADD COLUMN health_score INT DEFAULT 100; -- 0-100

Agentic Value: - Proactive churn prevention workflows - Auto-suggest upgrades at right moments - Trigger co-sell opportunities based on usage patterns


10. NEW TABLE: context_snapshots - Point-in-Time Context

CREATE TABLE context_snapshots (
    id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    snapshot_id VARCHAR(100) UNIQUE NOT NULL,

    -- Scope
    user_id BIGINT UNSIGNED NOT NULL,
    company_id BIGINT UNSIGNED NULL,
    product_id BIGINT UNSIGNED NULL,

    -- Snapshot data
    snapshot_type ENUM('auto', 'manual', 'milestone', 'handoff') NOT NULL,
    context_data JSON NOT NULL, -- Full context at this point

    -- References
    trigger_event VARCHAR(100) NULL, -- What triggered this snapshot
    workflow_chain_id VARCHAR(100) NULL,
    agent_session_id VARCHAR(100) NULL,

    -- Metadata
    expires_at TIMESTAMP NULL, -- For cleanup
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,

    FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,

    INDEX idx_company_snapshots (company_id, snapshot_type, created_at),
    INDEX idx_chain_snapshots (workflow_chain_id)
);

Agentic Value: - Capture context at key milestones - Enable "time travel" to understand what agent knew at decision point - Support warm handoffs between sessions


LOW Priority Opportunities

11. launch_readiness_scores - Add Trend Tracking

ALTER TABLE launch_readiness_scores ADD COLUMN previous_score INT NULL;
ALTER TABLE launch_readiness_scores ADD COLUMN score_trend ENUM('declining', 'stable', 'improving') NULL;
ALTER TABLE launch_readiness_scores ADD COLUMN days_until_target INT NULL;
ALTER TABLE launch_readiness_scores ADD COLUMN predicted_ready_date DATE NULL;

12. platform_knowledge_bases - Add Query Patterns

ALTER TABLE platform_knowledge_bases ADD COLUMN popular_queries JSON NULL;
ALTER TABLE platform_knowledge_bases ADD COLUMN gap_topics JSON NULL; -- Topics with no good answers
ALTER TABLE platform_knowledge_bases ADD COLUMN suggested_additions JSON NULL;

13. performance_predictions - Add A/B Test Tracking

ALTER TABLE performance_predictions ADD COLUMN variant_id VARCHAR(100) NULL;
ALTER TABLE performance_predictions ADD COLUMN is_control BOOLEAN DEFAULT TRUE;
ALTER TABLE performance_predictions ADD COLUMN actual_performance JSON NULL; -- Post-launch actuals

Implementation Priority Matrix

Enhancement GTM Stage Impact Implementation Effort Dependencies
companies journey tracking ALL Low None
products launch status PRE-LIST, LAUNCH Low None
partner_journey_events table ALL Medium companies, products
user_openai GTM context ALL Low companies, products
workflow_chains table ALL High user_openai
demo_requests lead scoring PRE-LIST Low None
compliance_reports remediation LAUNCH Medium workflow_chains
agent_sessions table ALL Medium None
marketplace_entitlements upsell SCALE, CO-SELL Low None
context_snapshots table ALL Medium agent_sessions

Phase 1: Foundation (Week 1-2)

  1. Add journey stage columns to companies
  2. Add launch status columns to products
  3. Create partner_journey_events table
  4. Enhance user_openai with GTM context

Phase 2: Workflow Orchestration (Week 3-4)

  1. Create workflow_chains table
  2. Create agent_sessions table
  3. Enhance compliance_reports with remediation links

Phase 3: Intelligence Layer (Week 5-6)

  1. Create context_snapshots table
  2. Enhance demo_requests with lead intelligence
  3. Add upsell signals to marketplace_entitlements

Phase 4: Optimization (Ongoing)

  1. Backfill existing data
  2. Train agents on journey patterns
  3. Build automation triggers

Agent Communication Patterns Enabled

With these enhancements, agents can:

  1. Query Company Context:

    "What stage is {company} at? What are their blockers?"
    

  2. Check Prerequisites:

    "Has {product} completed compliance check before MDF submission?"
    

  3. Chain Workflows:

    "Start MDF application chain → capture outputs → pass to next step"
    

  4. Handoff Context:

    "Content Strategist finishing → pass context to Technical Builder"
    

  5. Trigger Automation:

    "Compliance passed → trigger listing publication workflow"
    

  6. Learn from History:

    "What worked for similar companies at this stage?"