Skip to content

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Jan 5, 2026

Conditional Step Execution in PGFlow

This PR adds support for conditional step execution in PGFlow, allowing steps to be conditionally executed based on flow input or dependency outputs.

Key features:

  • Added condition_pattern and when_unmet columns to the steps table
  • Implemented condition evaluation in the start_ready_steps function
  • Added three handling modes for unmet conditions:
    • fail: Fails the step and the entire run
    • skip: Skips just the current step
    • skip-cascade: Skips the step and all its dependents

The implementation evaluates conditions before starting any steps:

  • For root steps, conditions are evaluated against the flow input
  • For dependent steps, conditions are evaluated against the aggregated outputs of dependencies

The DSL has been updated to support the new options:

flow.step(
  {
    slug: 'conditional_step',
    condition: { enabled: true },
    whenUnmet: 'skip'
  },
  () => 'result'
)

Comprehensive tests have been added to verify all condition evaluation scenarios and handling modes.

@changeset-bot
Copy link

changeset-bot bot commented Jan 5, 2026

⚠️ No Changeset found

Latest commit: 7372203

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@nx-cloud
Copy link

nx-cloud bot commented Jan 5, 2026

View your CI Pipeline Execution ↗ for commit 7372203

Command Status Duration Result
nx run edge-worker:test:integration ✅ Succeeded 3m 48s View ↗
nx run client:e2e ✅ Succeeded 1m 12s View ↗
nx run core:pgtap ✅ Succeeded 1m 43s 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 50s View ↗
nx run cli:e2e ✅ Succeeded 4s View ↗
nx run edge-worker:e2e ✅ Succeeded 41s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-08 11:26:50 UTC

@jumski jumski force-pushed the 01-05-add_condition_evaluation_in_start_ready_steps_and_dsl_support branch from 7bff913 to 7548924 Compare January 5, 2026 11:21
@jumski jumski force-pushed the 01-05-add_condition_evaluation_in_start_ready_steps_and_dsl_support branch from 7548924 to e255467 Compare January 5, 2026 12:16
@jumski jumski force-pushed the 01-05-add_condition_evaluation_in_start_ready_steps_and_dsl_support branch 2 times, most recently from 09b79a1 to 5e8c404 Compare January 6, 2026 06:19
@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
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