How tuannh982/simple-workflow-go works
• Client → Backend (Schedule workflows)
• Workers → Backend (Poll for tasks)
• Backend → Workers (Deliver tasks)
• Activity Results → Backend
• Workflow State → Backend
• Debug Information → Client
Key Subsystems (Group related components)
a. Execution Context
• Workflow Execution Context
• Activity Execution Context
• Context Propagators
b. Task Management
• Task Executors
• Task Processors
• Worker Threads
Important Elements
a. Data Converter Layer
• JSON data conversion between components
b. Promise/Future Pattern Implementation
• Activity Promises
• Timer Promises
c. Backend Storage Structure
• Events Table
• Tasks Table
• Workflow State Table
Specific Implementation Details
Notes or callouts for:
• Workflow Variable System (SetVar/GetVar)
• Activity Registration
• Error Handling Flow
• Retry Mechanisms
Architectural Patterns to Highlight
• Worker Pool Pattern
• Promise/Future Pattern
• Event Sourcing (History Events)
• Repository Pattern (PSQL Implementation)
[Client Layer]
• ↓
[Worker Layer]
• ↓
[Core Runtime]
• ↓
[Backend Layer]
Special Considerations:
How state is maintained and persisted
• How workflows are scheduled and executed
• How activities are distributed and processed
• How state is maintained and recovered
• How debugging and monitoring work
This will provide a clear understanding of the system's architecture while maintaining the right level of abstraction for a principal software engineer to understand both the high-level design and the important implementation details.