fix(workflows): make task failures non-blocking#555
Conversation
Wrap each workflow task in a shared runTask helper so that a single task failure no longer aborts the workflow. Previously, an unhandled task error would mark the workflow job as failed in payload-jobs, blocking all subsequent scheduled runs until the table was cleared manually. Now each task catches its own error, logs it to Sentry, and the workflow always completes — allowing the next cron cycle to start cleanly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@claude Review |
|
@codex review |
|
Claude finished @kelvinkipruto's task in 1m 8s —— View job Code Review
The change solves the immediate problem (blocked cron cycles due to unhandled task errors) with a clean, minimal helper. Overall the approach is solid, but there are a few things worth discussing. Issues1. Silent failure propagation through dependent tasks
With The same concern applies to A suggestion would be to return a boolean from 2.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c9aa6e2681
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Task errors are now swallowed by runTask before they can bubble up, so withWorkflowErrorCapture no longer fires for task failures. Add a comment acknowledging this so it is not mistaken for dead code — it remains as a safety net for errors thrown in the handler setup code itself, outside any runTask call. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaced Sentry.logger.error + captureException with captureException alone. Tasks using withTaskTracing already capture exceptions before re-throwing, so the previous two-call pattern risked triple-reporting the same error. captureException also preserves the full stack trace, which Sentry.logger.error discarded by only passing error.message. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Drop the workflow parameter — the Sentry span context from withWorkflowContext already carries the workflow name, so passing it explicitly at every call site was redundant noise. - Add explicit Promise<boolean> return type: true on success, false on failure, making the helper's intent clearer if callers ever need to act on the result. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@claude Review.
The intended approach is for each task to run independently, a failure on one should not affect other tasks |
|
Claude finished @kelvinkipruto's task in 1m 0s —— View job Code Review
Thanks for the clarification — understood that tasks are designed to be independent. That resolves concern #1. Here's the updated review focusing on what remains. The approach looks solidThe Remaining points1.
|
Remove duplicate Sentry captureMessage call in task logger to avoid double reporting. Remove Sentry.logger.error call in workflow error capture as Sentry.captureException already handles error reporting. Change cleanup failed jobs schedule from daily to hourly to improve system maintenance.
Description
Wrap each workflow task in a shared runTask helper so that a single task failure no longer aborts the workflow.
Previously, an unhandled task error would mark the workflow job as failed in payload-jobs, blocking all subsequent scheduled runs until the table was cleared manually. Now each task catches its own error, logs it to Sentry, and the workflow always completes — allowing the next cron cycle to start cleanly.
Fixes # (issue)
Type of change
Screenshots
Checklist: