Summary
Rewrite the Dapr JS SDK Workflow implementation to communicate directly with the Dapr sidecar's Workflow gRPC API, removing the current dependency on the DurableTask framework internals.
Background
The current workflow implementation in the JS SDK is built on top of an internal durabletask package (src/workflow/internal/durabletask/) that directly implements the DurableTask protocol — including its own orchestration replay logic, protobuf definitions, task hub worker, and gRPC transport. This approach:
- Couples the SDK tightly to DurableTask implementation details (proto definitions, replay semantics, orchestration state machine)
- Requires maintaining a complex internal framework that duplicates logic already handled by the Dapr sidecar
- Makes it harder to adopt new Dapr Workflow API features as they are added at the sidecar level
- Increases the SDK's surface area and maintenance burden significantly
Proposed Change
Rewrite the workflow subsystem to use the Dapr sidecar's native Workflow gRPC API directly (the same API used by DaprWorkflowClient for management operations). This means:
- Remove
src/workflow/internal/durabletask/ — the orchestration replay engine, proto files, task hub worker, and all DurableTask-specific types
- Implement workflow runtime against the Dapr Workflow API — register workflows and activities via the sidecar's streaming API, receive work items, and report completions through the sidecar
- Preserve the public API —
WorkflowRuntime, WorkflowContext, WorkflowActivityContext, DaprWorkflowClient, and all user-facing types should remain backward-compatible
- Use ConnectRPC/gRPC consistent with the rest of the SDK's client infrastructure
Current Architecture
WorkflowRuntime → TaskHubGrpcWorker → DurableTask gRPC protocol → Dapr sidecar WorkflowContext → OrchestrationContext (replay engine)
Target Architecture
WorkflowRuntime → Dapr Workflow gRPC API → Dapr sidecar WorkflowContext → Lightweight wrapper over sidecar-managed state
Acceptance Criteria
Dependencies
- Dapr sidecar Workflow API must support all operations currently used by the DurableTask worker (work item streaming, completion reporting, timer scheduling, external event handling, sub-orchestration, continue-as-new)
Summary
Rewrite the Dapr JS SDK Workflow implementation to communicate directly with the Dapr sidecar's Workflow gRPC API, removing the current dependency on the DurableTask framework internals.
Background
The current workflow implementation in the JS SDK is built on top of an internal
durabletaskpackage (src/workflow/internal/durabletask/) that directly implements the DurableTask protocol — including its own orchestration replay logic, protobuf definitions, task hub worker, and gRPC transport. This approach:Proposed Change
Rewrite the workflow subsystem to use the Dapr sidecar's native Workflow gRPC API directly (the same API used by
DaprWorkflowClientfor management operations). This means:src/workflow/internal/durabletask/— the orchestration replay engine, proto files, task hub worker, and all DurableTask-specific typesWorkflowRuntime,WorkflowContext,WorkflowActivityContext,DaprWorkflowClient, and all user-facing types should remain backward-compatibleCurrent Architecture
WorkflowRuntime → TaskHubGrpcWorker → DurableTask gRPC protocol → Dapr sidecar WorkflowContext → OrchestrationContext (replay engine)
Target Architecture
WorkflowRuntime → Dapr Workflow gRPC API → Dapr sidecar WorkflowContext → Lightweight wrapper over sidecar-managed state
Acceptance Criteria
src/workflow/internal/durabletask/is removedbuild-copy-workflow-proto) is no longer neededDependencies