Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[💡 FEATURE REQUEST]: Temporal Replay API #1640

Closed
rustatian opened this issue Jul 9, 2023 · 1 comment · Fixed by temporalio/roadrunner-temporal#394
Closed

[💡 FEATURE REQUEST]: Temporal Replay API #1640

rustatian opened this issue Jul 9, 2023 · 1 comment · Fixed by temporalio/roadrunner-temporal#394
Assignees
Labels
P-temporal Plugin: Temporal S-RFC Request: Request for comments
Milestone

Comments

@rustatian
Copy link
Member

rustatian commented Jul 9, 2023

Plugin

Temporal

I have an idea!

Temporal Replay API RFC: GO-SDK replay docs: link, SDK-GO workflow replayer: link

SDK-PHP ref: temporalio/sdk-php#227

PROTO API:

// ReplayRequest message contains all needed fields (which might be extended) to replay the workflow.

message ReplayRequest {
	temporal.api.common.v1.WorkflowExecution workflow_execution = 1;
	temporal.api.common.v1.WorkflowType workflow_type = 2;
	string save_path = 3;
	int64 last_event_id = 4;
}

// ReplayResponse contains Status response with the error details or nil if there are no errors.

// https://cloud.google.com/apis/design/errors
message ReplayResponse {
       Status status = 1;
}

message History {
  temporal.api.history.v1.History history = 1;
  temporal.api.common.v1.WorkflowType workflow_type = 2;
}

On error, RR will return the Status response with the appropriate error code. All status codes are described here: link

RR Response statuses for all requests :

  1. Missing fields in the request or data corruption: RR responds with the status code InvalidArgument (code 3) and an error message in the Message field.
  2. Internal errors (proto parsing, marshaling): Internal (code 13) error with error description in the Message status response field.
  3. Replays failure - FailedPrecondition (code 9). with the description of error in the Message status response field.

RoadRunner API:

1. Replay method:

ReplayWorkflow(in *protoApi.ReplayRequest, out *protoApi.ReplayResponse) error

Required fields in the ReplayRequest:

  • run_id
  • workflow_id
  • workflow_name

2. Download WF history:

DownloadWorkflowHistory(in *protoApi.ReplayRequest, out *protoApi.ReplayResponse) error

Required fields in the ReplayRequest:

  • run_id
  • workflow_id
  • save_path

3. Replay from the JSON file saved on the disk:

ReplayFromJSON(in *protoApi.ReplayRequest, out *protoApi.ReplayResponse) error

Required fields in the ReplayRequest:

  • workflow_name
  • save_path // path with the file

Optional:

  • last_event_id (int64). If this field is not 0 RR executes a single workflow task for the json history file upto provided last_event_id.

4. Replay from proto workflow history:

ReplayWofkflowHistory(in *protoApi.History, out *protoApi.ReplayResponse) error

Required fields in the ReplayRequest:

  • workflow_name

CC: @wolfy-j , @roxblnfk

@rustatian rustatian added the C-feature-request Category: feature requested, but need to be discussed label Jul 9, 2023
@rustatian rustatian self-assigned this Jul 9, 2023
@rustatian rustatian added S-RFC Request: Request for comments P-temporal Plugin: Temporal and removed C-feature-request Category: feature requested, but need to be discussed labels Jul 9, 2023
@rustatian rustatian added this to the v2023.3.0 milestone Jul 9, 2023
@rustatian
Copy link
Member Author

@roxblnfk updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-temporal Plugin: Temporal S-RFC Request: Request for comments
Projects
No open projects
Status: Unreleased
Development

Successfully merging a pull request may close this issue.

1 participant