Skip to content

Conversation

@rjrjr
Copy link
Contributor

@rjrjr rjrjr commented Jul 25, 2025

The One and Done entry was bad advice, or at least incomplete. Updated to describe the Skippable Workflow pattern we've been using with a lot of success lately.

Perhaps it's a simple boolean function indicating whether or not the child actually has any work to do:

```kotlin
state = if (stepTwoWorkflow.isThisNecessary()) RunStepTwo else RunStepThree
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only works if the stepTwoWorkflow is created and stored in the state a head of time, before you get to the apply(action) method. If your stepTwoWorkflow can't be created until you get into the apply(action) with a specific action/state, then you are out of luck.

Copy link
Contributor Author

@rjrjr rjrjr Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically in Kotlin child workflows are DI injected (available as constructor parameters of the parent), and actions are inner objects of the parent workflow with access to its injected dependencies.

In Swift, didn't a change just land to make the parent workflow available from the action? cc @jamieQ

@rjrjr rjrjr requested a review from steve-the-edwards July 25, 2025 20:19
The One and Done entry was bad advice, or at least incomplete. Updated to describe the Skippable Workflow pattern we've been using with a lot of success lately.
@rjrjr rjrjr merged commit 3a799fd into main Jul 28, 2025
3 checks passed
@rjrjr rjrjr deleted the ray/skippable branch July 28, 2025 20:29
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.

4 participants