# Teller Workflows Specification

## Overview

Workflow definitions for common VTM teller interactions.

## Workflow: Account Opening

**State Machine**:
```
[Start] → [Identity Verification] → [KYC Check] → [Account Creation] → [Wallet Setup] → [Complete]
              ↓                          ↓
           [Failed]                  [Manual Review]
```

**Steps**:
1. Collect user information
2. Initiate identity verification
3. Run KYC checks
4. Create account if approved
5. Set up wallet
6. Complete onboarding

## Workflow: Bridge Action

**State Machine**:
```
[Start] → [Select Chains] → [Enter Amount] → [Risk Check] → [Confirmation] → [Execute] → [Monitor] → [Complete]
                                                                    ↓
                                                                 [Failed]
```

**Steps**:
1. User requests bridge
2. Select source and destination chains
3. Enter amount
4. Get quote and show details
5. Risk assessment
6. User confirmation
7. Execute bridge
8. Monitor status
9. Confirm completion

## Workflow: Transaction Explanation

**Steps**:
1. User provides transaction hash
2. Fetch transaction details
3. Explain transaction components
4. Answer user questions
5. Provide additional context if needed

## User Consent Checkpoints

### Checkpoint Types

**Implicit Consent**: Information queries
**Explicit Consent**: Financial actions
**Strong Consent**: High-value or high-risk actions

### Consent Recording

**Record**:
- Action requested
- User acknowledgment
- Timestamp
- Method (voice, text, button)

## Audit Logging Requirements

### Logged Events

**All Events**:
- Workflow start/completion
- User inputs
- System actions
- Authorizations
- Escalations
- Errors

### Log Format

```json
{
  "session_id": "uuid",
  "user_id": "uuid",
  "workflow": "bridge_action",
  "event": "user_confirmation",
  "data": {...},
  "timestamp": "2024-01-01T00:00:00Z"
}
```

## References

- Teller Orchestrator: See `teller-orchestrator.md`
- Conversation State: See `conversation-state.md`

