oximedia-workflow
Comprehensive workflow orchestration engine for OxiMedia. Provides DAG-based workflow definition, task dependencies, parallel execution, state persistence, scheduling, REST API, and real-time monitoring.
Part of the oximedia workspace — a comprehensive pure-Rust media processing framework.
Version: 0.1.3 — 2026-04-15
Features
Core Engine
- DAG-based Workflows - Define complex workflows as directed acyclic graphs
- Task Dependencies - Automatic dependency resolution and topological sorting
- Parallel Execution - Run independent tasks concurrently with configurable limits
- State Persistence - SQLite-based workflow state management
- Retry Logic - Automatic retry with exponential backoff and configurable policies
- Conditional Branching - Execute tasks based on runtime conditions
- Step Conditions - Fine-grained conditional execution per step
- Approval Gates - Manual approval checkpoints within workflows
- SLA Tracking - Service level agreement monitoring and alerting
- Cost Tracking - Resource cost accumulation per workflow and task
- Workflow Versioning - Track workflow definition changes over time
- Workflow Snapshots - Save and restore workflow execution snapshots
- Checkpointing - Resume interrupted workflows from checkpoints
- Throttling - Rate limiting for workflow execution
Task Types
- Transcode - Media transcoding with preset selection
- QC Validation - Quality control checks
- File Transfer - Local, FTP, SFTP, S3, HTTP transfers
- Notifications - Email, Webhook, Slack, Discord
- Custom Scripts - Execute arbitrary scripts
- Media Analysis - Scene detection, quality analysis, and more
- HTTP Requests - Make HTTP/REST calls
- Wait - Simple delay tasks
Scheduling
- Cron Schedules - Standard cron expressions
- Watch Folders - Trigger on file arrival
- API Triggers - Manual or programmatic execution
- Time-based - One-time scheduled execution
- Event-based - Custom event triggers
- Interval - Periodic execution
- Manual - Explicit on-demand triggering
Monitoring
- Real-time Progress - Track workflow and task execution
- Metrics Collection - Duration, throughput, success rates
- Execution History - Historical workflow data
- System Statistics - Aggregate metrics
- Audit Log - Complete workflow audit trail
- Workflow Log - Structured per-workflow execution log
Integration
- REST API - Complete HTTP API for workflow management
- WebSocket - Real-time updates and event streaming
- CLI - Command-line interface
- Extensible - Custom task executors
Usage
Add to your Cargo.toml:
[]
= "0.1.3"
use ;
use Duration;
async
Workflow Patterns
use watch_folder_transcode;
use PathBuf;
// Watch folder auto-transcode
let workflow = watch_folder_transcode;
// Multi-pass encoding workflow
use multi_pass_encoding;
let workflow = multi_pass_encoding;
// Validation pipeline
use validation_pipeline;
let workflow = validation_pipeline;
Scheduling
use ;
let trigger = Cron ;
engine.schedule_workflow.await?;
REST API Endpoints
POST /api/v1/workflows— Create workflowGET /api/v1/workflows— List workflowsGET /api/v1/workflows/:id— Get workflowPOST /api/v1/workflows/:id/execute— Execute workflowGET /api/v1/workflows/:id/status— Get workflow statusPOST /api/v1/schedules— Create scheduleGET /api/v1/monitoring/statistics— Get statistics
API Overview
WorkflowEngine— Main engine: new(), in_memory(), submit_workflow(), execute_workflow(), schedule_workflow(), start(), stop(), api_router()Workflow/WorkflowId/WorkflowState/WorkflowConfig/Edge— Workflow data modelTask/TaskId/TaskType/TaskState/TaskResult/TaskPriority/RetryPolicy— Task managementWorkflowExecutor/DefaultTaskExecutor/TaskExecutor/ExecutionContext— Execution engineWorkflowScheduler/ScheduledWorkflow/Trigger/FileWatcher— SchedulingMonitoringService/WorkflowMetrics/TaskMetrics/SystemStatistics— MonitoringPersistenceManager— SQLite-backed workflow stateTaskQueue/QueueStatistics— Task queuingWorkflowBuilder/TaskBuilder/TranscodeTaskBuilder/QcTaskBuilder/TransferTaskBuilder— Builder APIsWorkflowDag/DagWorkflowEngine/WorkflowNode/WorkflowEdge/WorkflowTemplate— DAG engineWorkflowValidator/TaskValidator/ValidationReport/ComplexityAnalyzer— ValidationWebSocketManager/WorkflowEvent/WebSocketState— WebSocket integrationWorkflowError/Result— Error and result types- Modules:
api,approval_gate,audit_log,builder,cli,cost_tracking,dag,error,executor,monitoring,notification_system,patterns,persistence,queue,resource_pool,retry_policy,scheduler,sla,sla_tracking,state_machine,step_condition,step_result,task,task_dependency,task_graph,task_priority_queue,task_template,templates,triggers,utils,validation,websocket,workflow,workflow_audit,workflow_checkpoint,workflow_log,workflow_metrics,workflow_snapshot,workflow_throttle,workflow_version
License
Apache-2.0 — Copyright 2024-2026 COOLJAPAN OU (Team Kitasan)