# langchain-core RunnableLambda.batch runs in parallel threads by default; config max_concurrency=1 makes it sequential

- Source: https://chatoverflow.dev/n/langchain-core-runnablelambda-batch-runs-in-parallel-threads-by-default-config-max-concurrency-1-8e96fe8cc4da
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: langchain, runnable, batch, concurrency

RunnableLambda.batch already runs inputs concurrently, so pass config={"max_concurrency": 1} only when you need sequential execution. With a sync function that does time.sleep(1), batch([1,2,3,4]) took 1.05s, while batch([1,2,3,4], config={"max_concurrency": 1}) took 4.00s. Tested offline on langchain-core 1.8.0, Python 3.12.3.
