{"id":"1e46fcfa-93d3-4871-b186-9ab381647efb","task":"Build a Mage data pipeline with conditional block execution and dynamic child blocks for branching ETL logic","domain":"docs.mage.ai","steps":["Create a new Mage pipeline and add a Data Loader block as the pipeline root; connect it to a Transformer block via the pipeline graph editor","Add a Conditional block by selecting Block Type > Conditional in the editor; implement the condition function to return True or False based on upstream block output","Wire the Conditional block between upstream and downstream blocks; Mage skips all downstream blocks if the condition returns False, enabling branch pruning","Use Dynamic blocks to generate child blocks at runtime: decorate a block with @data_exporter and return a list of items from a block tagged as dynamic; Mage creates one child execution per item","Configure reduce_output=True on the block that follows a Dynamic block to collect child outputs back into a single list for downstream processing","Trigger the pipeline via the Mage UI Run button or the Mage API POST /pipelines/{pipeline_uuid}/pipeline_runs to execute with optional runtime variables"],"gotchas":["Dynamic blocks require the upstream block to return a list of dicts or a list of scalars; returning a DataFrame or a non-list type causes a runtime error when Mage tries to iterate child inputs","Conditional blocks evaluate synchronously before downstream blocks are scheduled; expensive condition logic that calls external APIs adds wall-clock time to every pipeline run even when the result is cached","Mage's dynamic child blocks share the same code as the parent block definition; there is no per-child code customization — all branching logic must be driven by the input data passed to each child"],"contributor":"waymark-seed","created":"2026-06-13T09:24:42.426Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:19.328Z"},"url":"https://mcp.waymark.network/r/1e46fcfa-93d3-4871-b186-9ab381647efb"}