|
6 | 6 |
|
7 | 7 | ## Overview |
8 | 8 |
|
9 | | -This is a proposal to enrich workflow activity context by introducing new fields. This will make it easier for users to control the workflow's state within activities. They are particularly useful for: |
| 9 | +This is a proposal to enrich workflow activity context by introducing new fields. This will make it easier for users to control the retries within activities. They are particularly useful for: |
10 | 10 |
|
11 | 11 | 1. **Idempotency**: Ensuring activities are not executed multiple times for the same task |
12 | | -2. **State Management**: Tracking the state of activity execution |
13 | 12 |
|
14 | 13 | ## Background |
15 | 14 |
|
16 | | -Workflow users have raised concerns about controlling and preventing an activity from being invoked more than once or tracking the state of the execution. Input parameters can be used to control the workflow's state, but certain scenarios do not have enough data to do it. Some examples are: |
| 15 | +Workflow users have raised concerns about controlling and preventing an activity from being invoked more than once. |
| 16 | +Input parameters can be used to control the workflow's state, but certain scenarios do not have enough data to do it. |
| 17 | +Some examples are: |
17 | 18 |
|
18 | 19 | - A notification activity where the message content alone isn't enough to determine uniqueness |
19 | 20 | - An external service call where idempotency can't be guaranteed by the input parameters |
@@ -53,24 +54,16 @@ An attempt to solve this problem has been tried in the JAVA-SDK. However, the so |
53 | 54 |
|
54 | 55 | The proposed fields introduced in this document are: |
55 | 56 |
|
56 | | -- WorkflowInstanceId: This field will provide a unique identifier for the workflow instance. It is already available in the orchestration context but will now be propagated to the activity context. |
57 | | - |
58 | | -- ActivityInstanceId: This field will provide a unique identifier for the same activity among retries. This new field will be part of the [Activity Request](https://github.com/dapr/durabletask-protobuf/blob/main/protos/orchestrator_service.proto) and needs to be populated in the runtime. |
| 57 | +- TaskExecutionId: This field will provide a unique identifier for the same activity among retries. This new field will be part of the [Activity Request](https://github.com/dapr/durabletask-protobuf/blob/main/protos/orchestrator_service.proto) and needs to be populated in the runtime. |
| 58 | +The new field will be present in the following entities: |
59 | 59 | ``` |
60 | | -message ActivityRequest { |
61 | | - string name = 1; |
62 | | - google.protobuf.StringValue version = 2; |
63 | | - google.protobuf.StringValue input = 3; |
64 | | - OrchestrationInstance orchestrationInstance = 4; |
65 | | - int32 taskId = 5; |
66 | | - TraceContext parentTraceContext = 6; |
67 | | - string activityInstanceId = 7; |
68 | | -} |
| 60 | + ActivityRequest |
| 61 | + TaskScheduledEvent |
| 62 | + TaskCompletedEvent |
| 63 | + TaskFailedEvent |
| 64 | + ScheduleTaskAction |
69 | 65 | ``` |
70 | 66 |
|
71 | | -- RetryAttempt: This field will contain the current retry count for the activity execution. |
72 | | - |
73 | | - |
74 | 67 | ### Feature lifecycle outline |
75 | 68 |
|
76 | 69 | * Expectations |
|
0 commit comments