Skip to content

Commit 7de3fb0

Browse files
committed
Added more docs for replaying a run
1 parent 4ae9a3f commit 7de3fb0

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

docs/images/v3/replay-run-action.png

124 KB
Loading
115 KB
Loading

docs/images/v3/replay-runs-list.png

113 KB
Loading

docs/v3/reattempting-replaying.mdx

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,53 @@ title: "Reattempting & Replaying"
33
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."
44
---
55

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+
<Tab title="From a run">
14+
Select a task, then in the bottom right click "Replay" ![Select a task, then in the bottom right
15+
click "Replay"](/images/v3/replay-run-action.png)
16+
</Tab>
17+
<Tab title="Runs list">
18+
<Steps>
19+
<Step title="Click the action button on a run">
20+
![On the runs page, press the triple dot button](/images/v3/replay-runs-list.png)
21+
</Step>
22+
<Step title="Click replay">![Click replay](/images/v3/replay-runs-list-popover.png)</Step>
23+
</Steps>
24+
</Tab>
25+
</Tabs>
26+
27+
### Replaying using the SDK
28+
29+
You can replay a run using the SDK:
30+
31+
```ts
32+
const replayedRun = await runs.replay(run.id);
33+
```
34+
35+
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+
export const 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.
54+
655
<Snippet file="coming-soon.mdx" />

0 commit comments

Comments
 (0)