Skip to main content

C4 Workflow Diagram - Level 3: Component Workflows

CODITECT Context Intelligence Platform

Diagram Level: 3 (Component) Focus: Workflows within containers at component level Audience: Developers Purpose: Understand component interactions and method calls


Workflow 1: Hybrid Search Component Flow

Component Responsibilities:

  • Auth Middleware: Token validation, user loading
  • Rate Limiter: Enforce tier limits
  • Authorization Service: Feature gating
  • SearchService: Orchestrate search + fusion
  • ConversationRepository: Database access
  • WeaviateClient: Vector search

Workflow 2: Create Conversation with Validation

Validation Rules:

  • Title: 1-200 characters
  • Messages: 1-1000 messages per conversation
  • Token count: <100K tokens per conversation
  • Organization quota check

Workflow 3: Correlation Service Algorithm

Scoring Thresholds:

  • High confidence (>0.9): Auto-link, badge green
  • Medium confidence (0.7-0.9): Auto-link, badge yellow
  • Low confidence (<0.7): No link

Workflow 4: Authorization Service RBAC Check

RBAC Matrix:

ActionOwnerAdminMemberViewer
create:conversation
read:own_conversation
read:all_conversations
update:own_conversation
delete:conversationOwn only
manage:users

Workflow 5: ConversationRepository RLS Enforcement

CRITICAL: Every query MUST include organization_id filter to prevent data leakage


Workflow 6: Error Handling Flow

Error Response Format (RFC 7807):

{
"type": "https://api.context-intelligence.com/errors/not-found",
"title": "Resource Not Found",
"status": 404,
"detail": "Conversation with ID abc-123 does not exist",
"instance": "/conversations/abc-123",
"trace_id": "7b3f0a2c-8d1e-4f5b-9c3a-1e2d3f4g5h6i"
}

Component Call Graph

API Endpoint
├─ calls → Auth Middleware
│ └─ calls → Auth Service
│ └─ calls → User Repository
├─ calls → Rate Limiter
│ └─ calls → Redis
├─ calls → Authorization Service
│ ├─ calls → User Repository
│ └─ calls → Redis (feature gates)
├─ calls → SearchService
│ ├─ calls → Conversation Repository
│ │ └─ calls → PostgreSQL
│ └─ calls → Weaviate Client
│ └─ calls → Weaviate API
└─ calls → Error Handler
└─ calls → Logger

Next Level: Code Workflows

The Component workflows show how components interact. The next level (Code Workflows) will show workflows at the method level with actual code execution flow.

See: c4-l4-workflow-code.md


Diagram Maintained By: Engineering Team Last Updated: 2025-11-26