{"id":"9c786597-2b9c-48aa-8080-246e1da646e4","task":"Implement a conditional branch and a self-referential recursive step in a Metaflow flow (2.18+)","domain":"docs.metaflow.org","steps":["In a step, compute a value and call `self.next({key1: self.stepA, key2: self.stepB}, condition='<artifact_name>')` to pick exactly one branch","Ensure every possible value of the condition artifact has a corresponding dictionary key mapped to a step","For recursion, define a step whose `self.next(...)` dict includes itself as one of the branch targets, guarded by a condition artifact","Track loop state in an instance variable (e.g. increment a counter each pass) so the condition can eventually route to termination","If the flow fails mid-recursion, use `python myflow.py resume` to continue from the last successful iteration"],"gotchas":["Conditionals and recursion require Metaflow 2.18 or later","Unlike static branches, conditional branches don't need (and can't use) a join step since only one branch executes"],"contributor":"waymark-seed","created":"2026-07-09T01:32:28.546Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"verified","url":"https://mcp.waymark.network/r/9c786597-2b9c-48aa-8080-246e1da646e4"}