effect-workflow

Build durable Effect workflows with activities, compensation, durable timers, and deferred signals.

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-workflow-lambdasolver2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-workflow
Source: https://github.com/lambdasolver2/opencode-effect-harness/tree/main/packages/module-typescript/assets/skills/effect-workflow
Command: npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-workflow-lambdasolver2

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires effect.

What problem does it solve? Long-running business processes in TypeScript lose all progress when a process restarts, and coordinating retries, external signals, and rollback across distributed steps is error-prone. This Skill guides building durable workflows with the Effect v4 effect/unstable/workflow module so executions survive restarts through event sourcing. ## Core Features & Use Cases - Durable Workflow & Activity Definitions: Define workflows with Workflow.make (payload schemas, idempotency keys) and persist activity results so replays skip re-execution. - Durable Primitives: Use DurableClock for restart-safe sleeps, DurableDeferred for waiting on external signals like webhooks, and DurableQueue for handing work to persisted background workers. - Saga Compensation & Cluster Integration: Register rollback logic with withCompensation and run on ClusterWorkflowEngine.layer for distributed, production-grade durability. - Use Case: Build an order-processing workflow that validates the order, reserves inventory with compensation, waits for a payment webhook via a durable deferred token, sleeps before shipping, and resumes correctly after a server restart. ## Quick Start Use the effect-workflow skill to create a durable order processing workflow with activities, a payment confirmation deferred, and compensation for inventory rollback.

Frequently Asked Questions about effect-workflow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a durable workflow in Effect TypeScript?

Use Workflow.make from effect/unstable/workflow with a unique name, payload schema, and idempotencyKey function. Register the handler with workflow.toLayer, then execute it via workflow.execute after providing a WorkflowEngine layer such as WorkflowEngine.layerMemory.

How do I make an Effect workflow wait for an external webhook?

Use DurableDeferred to pause the workflow until an external signal arrives. Define the deferred with success and error schemas, await it inside the workflow, and complete it from outside using DurableDeferred.succeed with a token generated via tokenFromExecutionId or tokenFromPayload.

What is the difference between WorkflowEngine.layerMemory and ClusterWorkflowEngine.layer?

WorkflowEngine.layerMemory is an in-memory engine for testing that provides no durability guarantees. ClusterWorkflowEngine.layer from effect/unstable/cluster integrates with Sharding and MessageStorage so executions, activities, and durable signals survive restarts and distribute across runners.

How does compensation work in Effect workflows?

Wrap top-level workflow effects with workflow.withCompensation, passing a rollback function that receives the success value and the failure Cause. If the workflow fails, registered compensations run in saga style, but compensation does not apply to logic nested inside activities.

Why does my Effect workflow re-execute side effects on replay?

Code outside activities re-runs on every replay, so HTTP calls, random values, and timestamps must be wrapped in Activity.make. Activities persist their results, and on replay the engine returns the cached result without re-executing the effect.