@@ -2674,57 +2674,59 @@ message PollActivityExecutionRequest {
26742674 string activity_id = 2 ;
26752675 // Activity run ID. If empty the request targets the latest run.
26762676 string run_id = 3 ;
2677- // Include the info field from the response.
2678- bool include_info = 4 ;
26792677 // Include the input field in the response.
2680- bool include_input = 5 ;
2681- // Include the outcome field in the response.
2682- bool include_outcome = 6 ;
2683-
2684- message StateChangeWaitOptions {
2685- // Token from a previous PollActivityExecutionResponse used to inform the server of the
2686- // last state seen by the caller. If present, run_id must also be present.
2687- bytes long_poll_token = 1 ;
2688- }
2689- message CompletionWaitOptions {}
2690-
2691- // If present, the request will be handled as a long-poll. If absent, a response will be
2692- // returned immediately containing the current activity state.
2693- oneof wait_policy {
2694- // Wait for any change in activity state before responding. If long_poll_token is absent
2695- // then the current state will be returned immediately without any wait. Otherwise the
2696- // server will wait until activity state differs from that encoded in the token before
2697- // returning the new state. Note that activity state may change multiple times between
2698- // requests, therefore it is not guaranteed that a client making a sequence of long-poll
2699- // requests will see a complete sequence of state changes.
2700- StateChangeWaitOptions wait_any_state_change = 8 ;
2701- // Wait for the activity to complete before responding.
2702- // long_poll_token is currently ignored when waiting for completion
2703- CompletionWaitOptions wait_completion = 9 ;
2704- }
2678+ bool include_input = 4 ;
2679+ // Include the result/failure in the response if the activity has completed.
2680+ bool include_result = 5 ;
2681+ // Token from a previous PollActivityExecutionResponse. If present, long-poll until activity
2682+ // state changes from the state encoded in this token. If absent, return current state immediately.
2683+ // If present, run_id must also be present.
2684+ // Note that activity state may change multiple times between requests, therefore it is not
2685+ // guaranteed that a client making a sequence of long-poll requests will see a complete
2686+ // sequence of state changes.
2687+ bytes long_poll_token = 6 ;
27052688}
27062689
27072690message PollActivityExecutionResponse {
27082691 // The run ID of the activity, useful when run_id was not specified in the request.
27092692 string run_id = 1 ;
27102693
2711- // Only set if include_info was true in the request .
2694+ // Information about the activity execution .
27122695 temporal.api.activity.v1.ActivityExecutionInfo info = 2 ;
27132696
27142697 // Serialized activity input, passed as arguments to the activity function.
2698+ // Only set if include_input was true in the request.
27152699 temporal.api.common.v1.Payloads input = 3 ;
27162700
2717- // Only set if the activity is completed and include_outcome was true in the request.
2701+ // Only set if the activity is completed and include_result was true in the request.
27182702 oneof outcome {
27192703 // The result if the activity completed successfully.
27202704 temporal.api.common.v1.Payloads result = 4 ;
27212705 // The failure if the activity completed unsuccessfully.
27222706 temporal.api.failure.v1.Failure failure = 5 ;
27232707 }
27242708
2725- // Token to use for a follow-on request using wait_any_state_change.
2726- // Only set if wait_policy was wait_any_state_change and the activity is not complete.
2727- bytes state_change_long_poll_token = 6 ;
2709+ // Token for follow-on long-poll requests. Absent only if the activity is complete.
2710+ bytes long_poll_token = 6 ;
2711+ }
2712+
2713+ message PollActivityExecutionOutcomeRequest {
2714+ string namespace = 1 ;
2715+ string activity_id = 2 ;
2716+ // Activity run ID. If empty the request targets the latest run.
2717+ string run_id = 3 ;
2718+ }
2719+
2720+ message PollActivityExecutionOutcomeResponse {
2721+ // The run ID of the activity, useful when run_id was not specified in the request.
2722+ string run_id = 1 ;
2723+
2724+ oneof outcome {
2725+ // The result if the activity completed successfully.
2726+ temporal.api.common.v1.Payloads result = 2 ;
2727+ // The failure if the activity completed unsuccessfully.
2728+ temporal.api.failure.v1.Failure failure = 3 ;
2729+ }
27282730}
27292731
27302732
0 commit comments