# Phoenix Transaction Orchestrator

**Category**: ORCHESTRATION_SERVICES  
**Publisher**: Phoenix Cloud Services  
**Status**: PUBLISHED  
**Version**: 1.0.0

## Overview

Phoenix Transaction Orchestrator provides on-chain and off-chain workflow orchestration with retries, compensations, provider routing, and fallback. Implements state machines for workflow management and enforces idempotency and exactly-once semantics.

## Key Features

- **Workflow state machines**: Clear state transitions
- **Retries and compensations**: Automatic retry with compensation logic
- **Provider routing**: Automatic failover between providers
- **Idempotency**: Enforced via correlation IDs
- **Exactly-once semantics**: Logical exactly-once delivery
- **On-chain and off-chain**: Unified orchestration for both

## API Endpoints

### Create Workflow

```http
POST /orchestrator/workflows
Content-Type: application/json

{
  "correlationId": "workflow_123",
  "steps": [
    {
      "type": "ON_CHAIN",
      "action": "transfer",
      "compensation": "reverse_transfer"
    },
    {
      "type": "OFF_CHAIN",
      "action": "notify_user"
    }
  ]
}
```

### Get Workflow Status

```http
GET /orchestrator/workflows/{workflowId}
```

### Retry Failed Step

```http
POST /orchestrator/workflows/{workflowId}/retry
Content-Type: application/json

{
  "stepId": "step_123"
}
```

## Pricing

- **Model**: Usage-based
- **Per Transaction**: $0.05
- **Per Workflow**: $0.10
- **Free Tier**: 1,000 transactions/month

## Compliance

- SOC 2 Type II

## SLA

- **Uptime**: 99.9%
- **Latency**: <500ms p95

## Architecture

- Database-backed state machines
- Worker queues for async processing
- Provider adapter pattern
- Compensation transaction support
