Commit 466dac0
committed
feat(executor): opt-in per-block retry
Adds a per-block retry policy, off by default, surfaced in the editor's
additional-fields disclosure alongside the block's other advanced settings.
A block that opts in replays its handler while tries remain, then rethrows the
final error so the error port behaves exactly as it does for a block that never
retried — retrying only delays the existing outcome, never changes it. Retry is
deliberately indiscriminate about the failure, since there is no reliable way to
tell a transient error from a permanent one and classifying would silently do
nothing for the generic errors people turn it on for. Only throws that are not
failures are excluded: a deliberate stop, a child workflow whose own blocks
already ran their policies, and the block types whose throw is control flow
(human-in-the-loop, sentinels, subflow containers, notes, triggers).
Eligibility lives in one predicate read by both the editor and the executor, so
a block can never keep retrying after an edit that hides its control.
`retry` is a nullable jsonb column; NULL means "runs once", which is how every
existing block already behaves, so the change is inert until someone opts in.
Bounds are clamped on read rather than rejected, so a value written before a
bound moved still resolves to something runnable.
Also decouples the additional-fields disclosure from `block.advancedMode`. That
flag decides which member of a canonical pair serializes, so opening the
disclosure used to be able to drop a block's configured credential. Expansion is
now view state; the stored flag is no longer written by the editor.
Retried blocks report their try count on the trace span, shown in log details.1 parent b6c007e commit 466dac0
31 files changed
Lines changed: 19784 additions & 16 deletions
File tree
- apps
- realtime/src/database
- sim
- app/workspace/[workspaceId]
- logs/components/log-details/components/trace-view
- w/[workflowId]/components/panel/components/editor
- components
- retry-settings
- executor
- execution
- hooks
- lib
- api/contracts
- logs
- execution/trace-spans
- workflows
- blocks
- comparison
- diff
- sanitization
- serializer
- stores/workflows/workflow
- packages
- db
- migrations
- meta
- realtime-protocol/src
- workflow-persistence/src
- workflow-types/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
768 | 768 | | |
769 | 769 | | |
770 | 770 | | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
771 | 800 | | |
772 | 801 | | |
773 | 802 | | |
| |||
962 | 991 | | |
963 | 992 | | |
964 | 993 | | |
| 994 | + | |
965 | 995 | | |
966 | 996 | | |
967 | 997 | | |
| |||
981 | 1011 | | |
982 | 1012 | | |
983 | 1013 | | |
| 1014 | + | |
984 | 1015 | | |
985 | 1016 | | |
986 | 1017 | | |
| |||
2172 | 2203 | | |
2173 | 2204 | | |
2174 | 2205 | | |
| 2206 | + | |
2175 | 2207 | | |
2176 | 2208 | | |
2177 | 2209 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
673 | 673 | | |
674 | 674 | | |
675 | 675 | | |
| 676 | + | |
676 | 677 | | |
677 | 678 | | |
678 | 679 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
Lines changed: 130 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
Lines changed: 56 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
194 | 197 | | |
195 | 198 | | |
196 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
197 | 215 | | |
198 | | - | |
199 | | - | |
| 216 | + | |
| 217 | + | |
200 | 218 | | |
201 | 219 | | |
202 | 220 | | |
| |||
257 | 275 | | |
258 | 276 | | |
259 | 277 | | |
260 | | - | |
| 278 | + | |
261 | 279 | | |
262 | 280 | | |
263 | 281 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
268 | 304 | | |
269 | 305 | | |
270 | 306 | | |
| |||
648 | 684 | | |
649 | 685 | | |
650 | 686 | | |
651 | | - | |
| 687 | + | |
652 | 688 | | |
653 | 689 | | |
654 | 690 | | |
| |||
698 | 734 | | |
699 | 735 | | |
700 | 736 | | |
701 | | - | |
| 737 | + | |
702 | 738 | | |
703 | 739 | | |
704 | 740 | | |
705 | 741 | | |
706 | | - | |
| 742 | + | |
707 | 743 | | |
708 | 744 | | |
709 | 745 | | |
| |||
716 | 752 | | |
717 | 753 | | |
718 | 754 | | |
719 | | - | |
| 755 | + | |
720 | 756 | | |
721 | 757 | | |
722 | 758 | | |
| |||
749 | 785 | | |
750 | 786 | | |
751 | 787 | | |
752 | | - | |
| 788 | + | |
753 | 789 | | |
754 | 790 | | |
755 | 791 | | |
| |||
762 | 798 | | |
763 | 799 | | |
764 | 800 | | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
765 | 809 | | |
766 | 810 | | |
767 | 811 | | |
| |||
0 commit comments