···371371372372:::
373373374374-### Flow Control
374374+## Stage Flow Control {#flow-control}
375375376376Stages may be optionally configured to **continue** to the next Stage or **stop** (end early) all subsequent Stages, based on the outcome of the currently running Stage.
377377···444444445445</details>
446446447447-### Conditional Modification
447447+### Conditionally Run {#conditional-modification}
448448449449[Stages](#stage) within a [Hook](#hook), and [Rules](#stage-rules) within each Stage, support a `when` object for testing **if they should be run.**
450450···452452453453All parts of an individual `when` clause must test true to "pass" but if **any** `when` clauses pass the Stage/Rule is processed.
454454455455+If the `when` test does not pass then the Stage is [**skipped (`onSkip`)**](#flow-control).
456456+455457```json5
456458{
457459 "when":
···538540539541## Logging
540542541541-MS can log the output of Stage transformations if/when they occur. In the `playTransform` object of a Source/Client config use `log`:
543543+MS can log a diff of Stage transformations if/when they occur. In the `playTransform` object of a Source/Client config use `log`:
542544543545* `"log": true` => Output original play + final transformed output of last Stage in the array
544546* `"log": "all"` => Output original play + final transformed output of **each** Stage in the array
···555557 }
556558}
557559```
560560+561561+<details>
562562+563563+<summary>Example</summary>
564564+565565+The output shows the diff between the previous stage (or original Play) and the current stage. In docker logs this is highlighted with diff syntax:
566566+567567+```diff
568568+[2025-12-17 08:53:10.467 -0500] DEBUG : [App] [Sources] [Lastfm - mylfm] [Play Transform] [preCompare] [VLDJJo] Transform Diff
569569+- Original
570570++ musicbrainz-MyMB
571571+572572+ Title : Demons Theme Part II (original 12" mix)
573573+ Artists : LTJ Bukem
574574+ Album Artists: (None)
575575+- Album : Producer 05: Rarities (Original 12" Version)
576576++ Album : Producer 05: Rarities (original 12" version)
577577+ Meta :
578578+ * brainz-album: 36759a8a-d3df-47da-a236-60f84fdc0cab
579579++ * brainz-artist: 28c1b7b7-355a-48b1-b2c4-75b8eb8080ef
580580++ * brainz-track: a0d51240-7ef1-4676-882e-be9f354075cb
581581++ * brainz-releaseGroup: e0cce74f-abcc-343b-9390-1673e4d57ce7
582582+```
583583+584584+</details>
558585559586## Examples
560587