# Understanding Kotlin Flow flatMapMerge behavior

DevFeed: [Understanding Kotlin Flow flatMapMerge behavior](<https://devfeed.tech/articles/flatmapmerge-is-weird-39307.md>)

Original publisher: [Read original article](<https://kt.academy/article/flat_map_merge>)

Published: 2024-03-06T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>)

Tags: [concurrency](<https://devfeed.tech/tags/concurrency.md>), [fetch](<https://devfeed.tech/tags/fetch.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

## AI overview

This article explains surprising aspects of Kotlin Flow's flatMapMerge, including its synchronous transformation step, default concurrency limit of 16, and inconsistent behavior when the concurrency is set to 1. It examines the implementation and presents patterns for handling asynchronous transformations.

## Source excerpt

How not to get surprised by flatMapMerge behavior.