File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ export const parentTask = task({
8181 <ResponseField name = " isTest" type = " boolean" >
8282 Whether this is a [ test run] ( /run-tests ) .
8383 </ResponseField >
84+ <ResponseField name = " isReplay" type = " boolean" >
85+ Whether this run is a [ replay] ( /replaying ) of a previous run.
86+ </ResponseField >
8487 <ResponseField name = " createdAt" type = " date" >
8588 The creation time of the task run.
8689 </ResponseField >
Original file line number Diff line number Diff line change @@ -30,6 +30,21 @@ description: "A replay is a copy of a run with the same payload but against the
3030 </Tab >
3131</Tabs >
3232
33+ ### Detecting replays in your task
34+
35+ You can check if a run is a replay using the [ context] ( /context ) object:
36+
37+ ``` ts
38+ export const myTask = task ({
39+ id: " my-task" ,
40+ run : async (payload , { ctx }) => {
41+ if (ctx .run .isReplay ) {
42+ // This run is a replay of a previous run
43+ }
44+ },
45+ });
46+ ```
47+
3348### Replaying using the SDK
3449
3550You can replay a run using the SDK:
You can’t perform that action at this time.
0 commit comments