Airbnb's Skipper is an open-source, embedded workflow engine designed for durable execution of multi-step business processes within existing services. It avoids a separate orchestration cluster by managing workflow state, scheduling, and recovery directly within the service's replicas and shared database. This approach simplifies deployments and integrates deeply with service dependencies, offering a trade-off between operational responsibility and reduced external dependencies.
Read original on Airbnb EngineeringTraditional durable workflow engines often rely on a central orchestration service, which can become a shared dependency and introduce network latency. Airbnb's Skipper presents an alternative: an embedded workflow engine. This architecture choice allows workflows to run directly within the application service, leveraging its existing deployment and database infrastructure. This removes the need for a separate, dedicated orchestration cluster, simplifying the overall system landscape for specific services.
Skipper's architecture integrates the workflow runtime and scheduler directly into the service's replicas. These replicas share a database to store workflow state and scheduled tasks. A scheduler component polls for runnable tasks, using leases for coordination among replicas. This design ensures that if a replica fails, another can take over the work, providing resilience and durability without external orchestration. The key trade-off here is that the service team now assumes full responsibility for workflow execution, database capacity, and recovery, rather than offloading it to a central team or managed service.
Key Architectural Principle
Skipper promotes co-location of workflow logic and service logic. This reduces inter-service communication overhead for workflow steps and simplifies deployment models by eliminating an external orchestrator. It's particularly appealing for teams with robust operational environments who prefer owning their workflow execution.
Skipper achieves durability through checkpointing and replay. When a workflow resumes after an interruption (e.g., service restart), it re-executes the workflow method from the beginning. Actions with persisted checkpoints return their saved results, allowing execution to continue from the last known state. This mechanism requires deterministic workflow code, meaning orchestration logic must be compatible with replay. Non-deterministic operations (like clock reads or randomness) must be encapsulated within actions or explicit checkpoints.
class PublishListing : Workflow() {
private val listing = actions<ListingActions>()
@StateField var reviewApproved: Boolean? = null
@WorkflowMethod suspend fun publish(request: PublicationRequest): Boolean {
if (request.requiresReview) {
val reviewed = waitUntil( { reviewApproved != null }, Duration.ofDays(1) )
if (!reviewed || reviewApproved != true) return false
}
listing.publish(request.listingId, request.requestId)
listing.notifyHost(request.listingId, request.requestId)
return true
}
@SignalMethod fun recordReview(approved: Boolean) {
reviewApproved = approved
}
}Skipper also supports Saga-style compensation for explicit recovery actions, a crucial pattern for managing consistency in distributed transactions where a series of local transactions might need to be rolled back in case of failure.