diff --git a/inc/Core/Steps/Fetch/Handlers/FetchHandler.php b/inc/Core/Steps/Fetch/Handlers/FetchHandler.php index 94fc07bd..27ec56f5 100644 --- a/inc/Core/Steps/Fetch/Handlers/FetchHandler.php +++ b/inc/Core/Steps/Fetch/Handlers/FetchHandler.php @@ -80,8 +80,10 @@ final public function get_fetch_data( int|string $pipeline_id, array $handler_co // Items without dedup_key pass through unchanged. $items = $this->dedup( $items, $context ); - // Apply max_items cap when configured. - $max_items = (int) ( $config['max_items'] ?? 0 ); + // Apply max_items cap. + // Default to 1 to prevent unbounded fan-out when flows lack an + // explicit max_items value. Set to 0 for unlimited. + $max_items = (int) ( $config['max_items'] ?? 1 ); if ( $max_items > 0 && count( $items ) > $max_items ) { $items = array_slice( $items, 0, $max_items ); }