You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "You can reattempt a task that has failed all of its attempts. You can also replay a task with a new version of your code."
4
4
---
5
5
6
+
## Replaying
7
+
8
+
A replay is a copy of a run with the same payload but against the latest version in that environment. This is useful if something went wrong and you want to try again with the latest version of your code.
9
+
10
+
### Replaying from the UI
11
+
12
+
<Tabs>
13
+
<Tabtitle="From a run">
14
+
Select a task, then in the bottom right click "Replay" 
16
+
</Tab>
17
+
<Tabtitle="Runs list">
18
+
<Steps>
19
+
<Steptitle="Click the action button on a run">
20
+

When you call `trigger()` or `batchTrigger()` on a task you receive back a run handle which has an `id` property. You can use that `id` to replay the run.
36
+
37
+
You can also access the run id from inside a run. You could write this to your database and then replay it later.
38
+
39
+
```ts
40
+
exportconst simpleChildTask =task({
41
+
id: "simple-child-task",
42
+
run: async (payload, { ctx }) => {
43
+
// the run ID (and other useful info) is in ctx
44
+
const runId =ctx.run.id;
45
+
},
46
+
});
47
+
```
48
+
49
+
### Reattempting
50
+
51
+
Tasks can [automatically reattempt](/v3/errors-retrying) based on the settings you provide.
52
+
53
+
Sometimes a task will fail all of its attempts. In that case, you can continue reattempting.
0 commit comments