Skip to content

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Jan 6, 2026

Add whenFailed option for error handling after retries are exhausted

This PR adds a new whenFailed option to control what happens when a task fails after all retry attempts are exhausted. The option supports three modes:

  • fail (default): Marks the step and run as failed, stopping execution
  • skip: Marks the step as skipped and continues the run
  • skip-cascade: Marks the step as skipped and also skips all downstream dependent steps

Implementation details:

  • Added when_failed column to the steps table with appropriate constraints
  • Enhanced fail_task function to handle the different failure modes
  • Added support for whenFailed option in the TypeScript DSL
  • Created comprehensive tests for all three failure modes
  • Ensured type violations still cause hard failures regardless of whenFailed setting

This feature provides more flexibility in error handling, allowing workflows to continue execution even when non-critical steps fail.

@changeset-bot
Copy link

changeset-bot bot commented Jan 6, 2026

🦋 Changeset detected

Latest commit: 2fd7a67

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@pgflow/core Patch
@pgflow/dsl Patch
pgflow Patch
@pgflow/client Patch
@pgflow/edge-worker Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@nx-cloud
Copy link

nx-cloud bot commented Jan 6, 2026

View your CI Pipeline Execution ↗ for commit 2fd7a67

Command Status Duration Result
nx run edge-worker:test:integration ✅ Succeeded 3m 53s View ↗
nx run client:e2e ✅ Succeeded 1m 9s View ↗
nx run cli:e2e ✅ Succeeded 4s View ↗
nx run edge-worker:e2e ✅ Succeeded 48s View ↗
nx run core:pgtap ✅ Succeeded 1m 45s View ↗
nx affected -t verify-exports --base=origin/mai... ✅ Succeeded 3s View ↗
nx affected -t build --configuration=production... ✅ Succeeded 3s View ↗
nx affected -t lint typecheck test --parallel -... ✅ Succeeded 25s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-14 08:18:21 UTC

@jumski jumski force-pushed the 01-05-add_condition_evaluation_in_start_ready_steps_and_dsl_support branch from 5e8c404 to c68bf9c Compare January 6, 2026 18:17
@jumski jumski force-pushed the 01-05-add_whenfailed_option_for_error_handling_after_retries_exhausted branch from ccaa5de to 46b2302 Compare January 6, 2026 18:17
@jumski jumski force-pushed the 01-05-add_whenfailed_option_for_error_handling_after_retries_exhausted branch from 46b2302 to c25ab9f Compare January 8, 2026 11:15
@jumski jumski force-pushed the 01-05-add_condition_evaluation_in_start_ready_steps_and_dsl_support branch from c68bf9c to 7372203 Compare January 8, 2026 11:15
@jumski jumski force-pushed the 01-05-add_condition_evaluation_in_start_ready_steps_and_dsl_support branch from 7372203 to ee6ad19 Compare January 11, 2026 19:26
@jumski jumski force-pushed the 01-05-add_whenfailed_option_for_error_handling_after_retries_exhausted branch from c25ab9f to 8863a35 Compare January 11, 2026 19:26
@jumski jumski force-pushed the 01-05-add_condition_evaluation_in_start_ready_steps_and_dsl_support branch from ee6ad19 to 0735264 Compare January 14, 2026 07:52
@jumski jumski force-pushed the 01-05-add_whenfailed_option_for_error_handling_after_retries_exhausted branch from 8863a35 to 2fd7a67 Compare January 14, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants