cas-reference-product implements a strictly typed request/response boundary using canonical
cas-contracts data structures, with interchangeable local and Foundry Next Gen agent adapters
behind the same WorkflowAgentService interface.
flowchart TD
Client[Client] -->|"POST /api/v1/workflows\nPromptEnvelope"| FastAPI["FastAPI Server\napp.py"]
FastAPI --> Middleware["W3CTraceContextMiddleware\ntelemetry.py"]
Middleware --> Router[Workflow Router]
Router --> Orchestrator["WorkflowOrchestrator\nworkflow.py"]
Orchestrator --> AgentService{"WorkflowAgentService\nworkflow.py"}
AgentService -->|Local Config| LocalAgent[LocalWorkflowAgentService]
AgentService -->|Foundry Config| FoundryAgent[FoundryWorkflowAgentService]
FoundryAgent -->|Managed Identity| AzureAuth["DefaultAzureCredential\nidentity.py"]
AzureAuth -->|Responses API| AzureAI[Azure AI Projects API]
AzureAI -->|Invoke Agent| FoundryNextGen[Foundry Next Gen Agent]
LocalAgent -->|Deterministic Output| Orchestrator
FoundryAgent -->|Agent Output| Orchestrator
Orchestrator -->|"RunEvent"| Router
Router -->|200 OK| Client
- FastAPI web layer (
app.py) — exposes/api/v1/workflows,/health/live,/health/ready; manages OpenTelemetry spans viaPromptEnvelope.correlationId. - Telemetry (
telemetry.py) —W3CTraceContextMiddlewareparses and propagatestraceparent/tracestateheaders. - Workflow Orchestrator (
workflow.py) — wraps agent execution, emits canonicalRunEventdata points (workflow.started,workflow.completed,workflow.failed). - Workflow Agent Service — the application boundary for AI logic, with local (deterministic) and Foundry Next Gen (managed-identity, Responses API) adapters behind one interface.
This project does not use Classic Assistants APIs and does not deploy Azure resources. Azure
deployment is locked workspace-wide until a future milestone is deliberately reached — no
service under this workspace may be provisioned or deployed from here. cas-platform, the
Container Apps target this repo's interface (deployment/cas-platform.interface.yaml) is built
for, is maintained "bicep-ready" (linted, parameterized, pinned per Phase 33) but is not itself
deployed. The Foundry Next Gen adapter in this repo is exercised only through local runs and
CI's Docker health-check smoke test (ci.yml's docker job) — never a live Azure deploy.
Deploys as a Linux container image on port 8080 (internal ingress by default), exposing
/health/live and /health/ready. Workload configuration is non-secret and injected at
runtime; Application Insights connection strings are injected securely from the platform's
observability module outputs.
