Skip to main content

Recording Management

Endpoints for managing automation session recordings.

Recording Listing

GET /api/recording/list

Lists all recordings.

Query Parameters:

  • flowId: Filter by flow ID
  • deviceId: Filter by device ID
  • limit: Maximum recordings to return (default: 20)
  • offset: Number of recordings to skip (default: 0)

Response:

{
"recordings": [
{
"id": "recording-123",
"filename": "flow-login-2024-01-01-12-00-00.mp4",
"flowId": "flow-456",
"deviceId": "device-789",
"duration": 45000,
"fileSize": 12500000,
"resolution": "1080x2400",
"bitrate": "8M",
"createdAt": "2024-01-01T12:00:00.000Z",
"path": "/recordings/flow-login-2024-01-01-12-00-00.mp4"
}
],
"total": 1,
"limit": 20,
"offset": 0
}

GET /api/recording/active

Gets information about the currently active recording.

Response:

{
"isRecording": true,
"recordingId": "recording-123",
"flowId": "flow-456",
"deviceId": "device-789",
"startTime": "2024-01-01T12:00:00.000Z",
"duration": 30000,
"tempPath": "/tmp/recording-active.mp4"
}

GET /api/recording/info/:recordingId

Gets detailed information about a specific recording.

Parameters:

  • recordingId: Recording identifier

Response:

{
"id": "recording-123",
"filename": "flow-login-2024-01-01-12-00-00.mp4",
"flowId": "flow-456",
"deviceId": "device-789",
"metadata": {
"duration": 45000,
"fileSize": 12500000,
"resolution": "1080x2400",
"bitrate": "8M",
"fps": 30,
"codec": "h264",
"audioCodec": "aac"
},
"thumbnails": [
{
"timestamp": 10000,
"path": "/thumbnails/recording-123-10000.jpg"
}
],
"createdAt": "2024-01-01T12:00:00.000Z",
"path": "/recordings/flow-login-2024-01-01-12-00-00.mp4"
}

GET /api/recording/flow/:flowId

Gets recordings for a specific flow.

Parameters:

  • flowId: Flow identifier

Query Parameters:

  • limit: Maximum recordings to return

Response: Similar to GET /api/recording/list but filtered by flow.

GET /api/recording/video/:filename

Streams a recording video file.

Parameters:

  • filename: Recording filename

Response: Video file stream with appropriate content-type headers.

GET /api/recording/download/:filename

Downloads a recording file.

Parameters:

  • filename: Recording filename

Response: File download with appropriate headers.

GET /api/recording/debug/flow-associations

Debug endpoint for checking flow-recording associations.

Response:

{
"associations": [
{
"flowId": "flow-456",
"recordingId": "recording-123",
"confidence": "high",
"matchedBy": "filename_pattern"
}
],
"orphanedRecordings": 5,
"unassociatedFlows": 2
}

Recording Control

POST /api/recording/start

Starts recording an automation session.

Request Body:

{
"flowId": "flow-456",
"deviceId": "device-789",
"options": {
"duration": 3600000, // 1 hour max
"resolution": "1080p",
"bitrate": "8M",
"fps": 30,
"includeAudio": true,
"generateThumbnails": true
}
}

Response:

{
"success": true,
"recordingId": "recording-123",
"message": "Recording started",
"estimatedSize": "250MB"
}

POST /api/recording/stop

Stops the active recording.

Request Body:

{
"recordingId": "recording-123",
"save": true
}

Response:

{
"success": true,
"recordingId": "recording-123",
"filename": "flow-login-2024-01-01-12-00-00.mp4",
"duration": 45000,
"fileSize": 12500000,
"path": "/recordings/flow-login-2024-01-01-12-00-00.mp4"
}

DELETE /api/recording/:recordingId

Deletes a recording.

Parameters:

  • recordingId: Recording identifier

Request Body:

{
"deleteFile": true // Also delete the actual video file
}

Response:

{
"success": true,
"deleted": "recording-123",
"fileDeleted": true
}

Recording Configuration

Default Settings

{
"directory": "./recordings",
"maxDuration": 3600000, // 1 hour
"defaultBitrate": "8M",
"defaultResolution": "1080p",
"defaultFps": 30,
"maxFileSize": 1073741824, // 1GB
"retentionDays": 30,
"generateThumbnails": true,
"thumbnailInterval": 10000 // 10 seconds
}

Supported Formats

Video Codecs

  • H.264 (default)
  • H.265 (HEVC)
  • VP8/VP9

Audio Codecs

  • AAC (default)
  • MP3
  • Opus

Containers

  • MP4 (default)
  • WebM
  • MOV

Usage Examples

Start Recording

curl -X POST http://localhost:3001/api/recording/start \
-H "Content-Type: application/json" \
-d '{
"flowId": "flow-456",
"deviceId": "device-789"
}'

List Recordings for Flow

curl "http://localhost:3001/api/recording/flow/flow-456?limit=5"

Download Recording

curl -O "http://localhost:3001/api/recording/download/flow-login-2024-01-01-12-00-00.mp4"

Stop Recording

curl -X POST http://localhost:3001/api/recording/stop \
-H "Content-Type: application/json" \
-d '{
"recordingId": "recording-123"
}'

Storage Management

Automatic Cleanup

  • Old recordings are automatically deleted after retentionDays
  • Large files exceeding maxFileSize are rejected
  • Storage usage is monitored and alerts generated when near capacity

File Organization

recordings/
├── flow-{flowId}-{timestamp}.mp4
├── thumbnails/
│ └── recording-{id}-{timestamp}.jpg
└── temp/
└── recording-active-{sessionId}.mp4

Performance Considerations

  • Use appropriate bitrate for storage vs quality tradeoff
  • Enable thumbnails only when needed for browsing
  • Consider compression for long-term storage
  • Use external storage for large recording libraries