Skip to content

Experience Service

Smart experience orchestration service with DAG support, state management, and lifecycle hooks.

Phase 2 in progress — Plan #021 (Smart Experience DAG Orchestrator) is rolling out across slices A–G. Slice 0 (foundation) landed on 2026-05-04: migrations directory, skeleton HTTP clients (partner/calendar/review), and empty intent/scoring/external module shells. Subsequent slices fill in business logic; expect the surface in this README to grow.

Overview

The Experience Service handles: - Experience CRUD operations - DAG-based service composition - State machine for service lifecycle management - Lifecycle hook execution (onStart, onEnd, onSuccess, onFailure) - Context-aware service composition - Real-time bidirectional communication via RabbitMQ - Parallel and sequential service execution

API Endpoints

Experiences

  • GET /api/experiences - List all experiences
  • GET /api/experiences/:id - Get experience by ID
  • POST /api/experiences - Create new experience (with optional DAG)
  • POST /api/experiences/:id/start - Start experience execution
  • GET /api/experiences/:id/graph - Get DAG structure
  • GET /api/experiences/:id/state - Get current state of experience and services

Database Schema

See services/experience-service/src/common/database/database.service.ts for schema definitions.

State Machine

Service instances progress through states: - PENDING → CONFIGURED → ACTIVE → COMPLETED/FAILED - Can be SUSPENDED from ACTIVE - Can be CANCELLED from any state

Events Published

None at present. The earlier experience.events exchange was removed in W2-10b (Riff #32, 2026-04-30) — it had zero consumers. Plan #021 re-adds the audit trail with proper consumers.

Environment Variables

  • PORT - Service port (default: 3000)
  • DATABASE_URL - PostgreSQL connection string