Commit 9229002
fix(execution): queued execution finalization and async correlation (#3535)
* fix(execution): finalize runs before wrapper recovery
* fix(async): preserve execution correlation across queued runs
* fix(webhooks): pass correlation into preprocessing
* style(webhooks): normalize webhook executor formatting
* fix(async): avoid pre-starting queued execution logs
Let executeWorkflowCore own normal-path logging start so queued workflow and schedule executions persist the richer deployment and environment metadata instead of an earlier placeholder start record.
* fix(async): harden execution finalization guards
Prevent leaked core finalization markers from accumulating while keeping outer recovery paths idempotent. Preserve best-effort logging completion by reusing settled completion promises instead of reopening duplicate terminal writes.
* fix(async): preserve outcomes during cleanup
Keep execution finalization cleanup best-effort so cancellation cleanup failures do not overwrite successful or failed outcomes. Restore webhook processor formatting to the repository Biome style to avoid noisy formatter churn.
* fix(async): keep execution finalization state consistent
Retry minimal logging for early failures, only mark core finalization after a log row actually completes, and let paused completions fall back cleanly.
* fix(async): clean stale finalization guards
Scan all finalized execution ids during TTL cleanup so refreshed keys cannot keep expired guards alive, and cover the reused-id ordering regression.
* fix(async): retry failed error finalization
Allow error finalization to retry after a non-error completion and fallback both fail, and always persist failed/error semantics for completeWithError.
* fix(webhooks): reuse preprocessing execution ids
Thread preprocessing execution identity into queued webhook execution so both phases share the same correlation and logs.
---------
Co-authored-by: test <test@example.com>1 parent d84cba6 commit 9229002
File tree
26 files changed
+2453
-166
lines changed- apps/sim
- app/api
- schedules/execute
- webhooks/trigger/[path]
- workflows/[id]/execute
- background
- executor/execution
- lib
- core/async-jobs
- backends
- execution
- logs
- execution
- webhooks
- workflows/executor
26 files changed
+2453
-166
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
111 | 115 | | |
112 | 116 | | |
113 | 117 | | |
| |||
204 | 208 | | |
205 | 209 | | |
206 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
207 | 251 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
60 | 71 | | |
61 | 72 | | |
62 | 73 | | |
63 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
64 | 78 | | |
65 | 79 | | |
66 | 80 | | |
| |||
71 | 85 | | |
72 | 86 | | |
73 | 87 | | |
74 | | - | |
| 88 | + | |
75 | 89 | | |
76 | 90 | | |
77 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| |||
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
128 | 133 | | |
129 | 134 | | |
130 | 135 | | |
| |||
350 | 355 | | |
351 | 356 | | |
352 | 357 | | |
353 | | - | |
354 | | - | |
355 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
356 | 373 | | |
357 | 374 | | |
358 | 375 | | |
359 | 376 | | |
360 | 377 | | |
361 | 378 | | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
| 379 | + | |
368 | 380 | | |
369 | 381 | | |
370 | 382 | | |
| |||
419 | 431 | | |
420 | 432 | | |
421 | 433 | | |
422 | | - | |
| 434 | + | |
423 | 435 | | |
424 | 436 | | |
425 | 437 | | |
| |||
494 | 506 | | |
495 | 507 | | |
496 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
497 | 550 | | |
498 | 551 | | |
499 | 552 | | |
| |||
514 | 567 | | |
515 | 568 | | |
516 | 569 | | |
517 | | - | |
| 570 | + | |
518 | 571 | | |
519 | 572 | | |
520 | 573 | | |
| |||
544 | 597 | | |
545 | 598 | | |
546 | 599 | | |
547 | | - | |
| 600 | + | |
548 | 601 | | |
549 | 602 | | |
550 | 603 | | |
| |||
575 | 628 | | |
576 | 629 | | |
577 | 630 | | |
578 | | - | |
| 631 | + | |
579 | 632 | | |
580 | 633 | | |
581 | 634 | | |
| |||
610 | 663 | | |
611 | 664 | | |
612 | 665 | | |
613 | | - | |
| 666 | + | |
614 | 667 | | |
615 | 668 | | |
616 | 669 | | |
| |||
645 | 698 | | |
646 | 699 | | |
647 | 700 | | |
648 | | - | |
| 701 | + | |
649 | 702 | | |
650 | 703 | | |
651 | 704 | | |
| |||
668 | 721 | | |
669 | 722 | | |
670 | 723 | | |
671 | | - | |
| 724 | + | |
672 | 725 | | |
673 | 726 | | |
674 | 727 | | |
| |||
696 | 749 | | |
697 | 750 | | |
698 | 751 | | |
699 | | - | |
| 752 | + | |
700 | 753 | | |
701 | 754 | | |
702 | 755 | | |
| |||
716 | 769 | | |
717 | 770 | | |
718 | 771 | | |
719 | | - | |
| 772 | + | |
720 | 773 | | |
721 | 774 | | |
722 | 775 | | |
| |||
744 | 797 | | |
745 | 798 | | |
746 | 799 | | |
747 | | - | |
| 800 | + | |
748 | 801 | | |
749 | 802 | | |
750 | 803 | | |
| |||
772 | 825 | | |
773 | 826 | | |
774 | 827 | | |
775 | | - | |
| 828 | + | |
776 | 829 | | |
777 | 830 | | |
778 | 831 | | |
| |||
797 | 850 | | |
798 | 851 | | |
799 | 852 | | |
800 | | - | |
| 853 | + | |
801 | 854 | | |
802 | 855 | | |
803 | 856 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
| |||
0 commit comments