Skip to content

Commit 11b5625

Browse files
committed
Adds RPCs for workflow list and get history
Signed-off-by: joshvanl <[email protected]>
1 parent 282f568 commit 11b5625

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

20251028-RS-workflow-list.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Workflow List and History RPCs for Durable Task
2+
3+
* Author(s): @joshvanl
4+
5+
## Overview
6+
7+
This proposal adds two new RPCs to the durabletask framework which are used to support observability and discoverability of running and completed workflows in Dapr.
8+
Specifically, adding a `ListInstances` and `GetInstanceHistory` RPC to the durabletask gRPC service.
9+
10+
## Background
11+
12+
Today, there is no ways of discovering the list of workflow instances that are currently running or have completed in the past without using external storage queries.
13+
The Dapr CLI [introduced list and workflow history commands](https://github.com/dapr/cli/pull/1560) to get information about running and completed workflows, however these commands rely on direct queries to the underlying storage provider.
14+
By introducing this functionality into the durabletask framework itself, these commands need only talk to Daprd, removing the requirement for direct access to the storage provider as well as authentication.
15+
Daprd can make these queries itself, and use the Actor State Store component to access the underlying storage.
16+
17+
## Related Items
18+
19+
## Implementation Details
20+
21+
### Design
22+
23+
Two new RPCs will be added to the durabletask gRPC service, which will be available to both the application client, as well as the dapr CLI.
24+
25+
```proto
26+
service TaskHubSidecarService {
27+
rpc ListInstances (ListInstancesRequest) returns (ListInstancesResponse);
28+
rpc GetInstanceHistory (GetInstanceHistoryRequest) returns (GetInstanceHistoryResponse);
29+
}
30+
31+
// ListInstancesRequest is used to list all orchestration instances.
32+
message ListInstancesRequest {
33+
// continuationToken is the continuation token to use for pagination. This
34+
// is the index which the next page should start from. If not given, the first
35+
// page will be returned.
36+
optional uint32 continuationToken = 1;
37+
38+
// pageSize is the maximum number of instances to return for this page. If
39+
// not given, all instances will be attempted to be returned.
40+
optional uint32 pageSize = 2;
41+
}
42+
43+
// ListInstancesResponse is the response to executing ListInstances.
44+
message ListInstancesResponse {
45+
// instanceIds is the list of instance IDs returned.
46+
repeated string instanceIds = 1;
47+
}
48+
49+
// GetInstanceHistoryRequest is used to get the full history of an
50+
// orchestration instance.
51+
message GetInstanceHistoryRequest {
52+
string instanceId = 1;
53+
}
54+
55+
// GetInstanceHistoryResponse is the response to executing GetInstanceHistory.
56+
message GetInstanceHistoryResponse {
57+
repeated HistoryEvent events = 1;
58+
}
59+
```

0 commit comments

Comments
 (0)