Skip to content

Commit 64983d8

Browse files
docs for cancel-pending (#756)
1 parent 5d60a1d commit 64983d8

3 files changed

Lines changed: 69 additions & 5 deletions

File tree

docs/monitor-history/activity-history.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ OpenFn Workflows are executed as follows:
3434
`Run` will be created. If successful, then both the Run and related Work
3535
Order will be updated with a `success` status.
3636

37+
You can also **cancel** pending runs or **retry** completed work orders directly
38+
from the History page. See [Retry & Cancel Runs](./rerunning-workflow.md) for
39+
details.
40+
3741
![History Page](/img/history-page-annotated.webp)
3842

3943
Check out the other pages in this docs section to learn more about inspecting

docs/monitor-history/rerunning-workflow.md

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,38 @@
11
---
2-
title: Rerun after failures & Workflow edits
3-
sidebar_label: Rerun failures
2+
title: Retry & Cancel Runs
3+
sidebar_label: Retry & Cancel
44
---
55

6+
From the `History` page, you can take actions on Work Orders and Runs depending
7+
on their current state. Use **Retry** to re-execute completed work orders, or
8+
**Cancel** to remove pending runs from the queue.
9+
10+
## Available Actions by Work Order State
11+
12+
| Work Order State | Available Actions |
13+
| :-------------------------------------------------------------------------------------------- | :---------------- |
14+
| **Pending** (runs waiting in the queue) | Cancel |
15+
| **Running** | None |
16+
| **Final states** (Success, Failed, Crashed, Killed, Exception, Lost, Cancelled, Rejected) | Retry, Retry from |
17+
18+
:::info Selecting work orders with mixed states
19+
20+
When you select multiple work orders with different state categories (e.g., some
21+
pending and some failed), both Retry and Cancel buttons will be disabled. Select
22+
only work orders in the same state category to use bulk actions.
23+
24+
:::
25+
26+
## Retry a Work Order
27+
628
Did a step in your workflow fail? Looking to resync historical data? Whatever
729
the reason, watch the below video tutorial
830
([or see link](https://youtu.be/DvLRA6kloNE?si=U0NMx-HsCMZxeJwg)) to learn how
931
to rerun your Workflow.
1032

1133
<iframe width="784" height="441" src="https://www.youtube.com/embed/DvLRA6kloNE?si=Seczc1JFhThQBbUv" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
1234

13-
## Rerun via History page
35+
### Retry via History page
1436

1537
To rerun your Workflow from the `History` page:
1638

@@ -22,7 +44,7 @@ To rerun your Workflow from the `History` page:
2244
4. This will create a new `Run` related to the same Work Order. Check the
2345
`Status` to see if this Run successfully completed the Work Order.
2446

25-
## Rerun via Inspector view
47+
### Retry via Inspector view
2648

2749
To rerun your Workflow from the `Inspector` page:
2850

@@ -40,3 +62,41 @@ To rerun your Workflow from the `Inspector` page:
4062
6. If you prefer to create a _new_ Work Order (instead of retrying the same Work
4163
Order), you can click the dropdown next to "Rerun from here" and _instead_
4264
choose `Create New Work Order`.
65+
66+
## Cancel Pending Runs
67+
68+
If runs are stuck in the queue or were created by mistake, you can cancel them.
69+
Cancelling moves runs from `available` to `cancelled` and updates the
70+
corresponding work order status from `pending` to `cancelled`. See
71+
[Status Codes](./status-codes.md) for more on what each status means.
72+
73+
There are several ways to cancel:
74+
75+
- **Cancel all runs for a work order:** Click the action button on a pending
76+
work order row in the History page to cancel all of its pending runs.
77+
- **Cancel a single run:** Click the cancel button next to an individual run
78+
item, either in the run list or on the run detail page.
79+
80+
:::note Runs that start before confirmation
81+
82+
If a pending run begins executing between the time you open the cancel
83+
confirmation dialog and the time you confirm, that run will **not** be
84+
cancelled. Only runs still in the queue at the moment of confirmation are
85+
affected.
86+
87+
:::
88+
89+
## Bulk Actions
90+
91+
You can act on multiple work orders at once by selecting them via checkboxes on
92+
the History page:
93+
94+
- **Bulk Cancel:** Select work orders in the `Pending` state, then click the
95+
`Cancel` button to cancel all pending runs across the selected work orders.
96+
- **Bulk Retry:** Select work orders in a final state (e.g., Failed, Crashed),
97+
then click the `Retry` button.
98+
99+
Bulk action buttons are only enabled when all selected work orders share the
100+
same state category. Selecting work orders with mixed states (e.g., some pending
101+
and some failed) or selecting only running work orders will disable all action
102+
buttons.

docs/monitor-history/status-codes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Every Run has a status which indicates whether it completed successfully.
3333
| Failed | 🔴 | RangeError | No | Calling `state.patients[5]` when only 2 patients exist |
3434
| Crashed | 🟠 | SyntaxError | Yes | You've got some bad JavaScript and the worker cannot compile your job code |
3535
| Crashed | 🟠 | ReferenceError | Yes | You've got an undeclared variable in your job code |
36-
| Cancelled || | Yes | The run had been enqueued but was manually removed from the queue |
36+
| Cancelled || | Yes | The run had been enqueued but was [manually removed](./rerunning-workflow.md#cancel-pending-runs) from the queue |
3737
| Killed | 🟡 | SecurityError | Yes | Your code failed security checks, e.g. tried to use `eval` |
3838
| Killed | 🟡 | ImportError | Yes | You tried to import external module that we don't allow |
3939
| Killed | 🟡 | OomError | Yes | Your run used more memory than allowed by the Lightning instance |

0 commit comments

Comments
 (0)