core-dev
Development guide for lemline-core, the stateless Serverless Workflow engine. Manage workflow execution, node navigation, state transitions, JQ expression evaluation, error handling, and parallel fork logic.
Introduction
The core-dev skill provides comprehensive guidance for engineering and extending the lemline-core module, the functional, stateless workflow execution engine at the heart of Lemline. Designed for developers working on business process automation, this skill covers the implementation of the Serverless Workflow DSL v1.0, enabling users to orchestrate complex task trees with high reliability and efficiency. It is intended for software engineers building distributed systems who need to manage state transitions, parallel branch execution, and complex error recovery patterns without the overhead of sticky sessions or shared memory architectures.
-
Advanced Workflow Orchestration: Deep integration with StepByStepOrchestrator and FullOrchestrator for managing workflow life cycles, execution flow control, and synchronous unit testing.
-
Node Tree Navigation: Management of immutable Node structures and dynamic NodePosition addressing for precise task execution tracking.
-
State Lifecycle Management: Handling TaskState, WorkflowCommands, and WorkflowEvents with strict adherence to stateless principles and efficient serialization.
-
Logic and Expression Processing: Implementation of JQ expression evaluation, scope variable management, and transformation helpers for dynamic data handling.
-
Resilient Error Handling: Utilization of AsyncTaskException for exception-driven control flow, including retry, catch, and try/catch processor strategies.
-
Parallel and Fork Logic: Robust management of parallel branches using ForkProcessors, error boundaries, and branch synchronization.
-
Always maintain stateless processor logic by receiving state and returning updated NextStepInfo to prevent memory leaks and state corruption.
-
Use exception-driven control flow (AsyncTaskException) to trigger wait, fork, or runWorkflow actions rather than relying on standard runtime exceptions.
-
Ensure all custom TaskState subclasses are marked @Serializable to facilitate the stateless worker pattern and horizontal scalability.
-
Leverage the FullOrchestrator for robust unit testing of workflow logic and use StepByStepOrchestrator for production environments.
-
Build node trees using lazy initialization (by lazy) to optimize performance and memory footprint during complex workflow execution.
Repository Stats
- Stars
- 37
- Forks
- 0
- Open Issues
- 6
- Language
- Kotlin
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- May 3, 2026, 03:37 PM