Creates a function that invokes the given functions from left to right, passing each return value to the next. Part of Lodash Util since 3.0.0 (stable — not deprecated).
Note: Only the first function receives all outer arguments. Later steps get one value. See also _.flowRight for right-to-left order.
Syntax
Call _.flow. Start with this line.
Lodash
_.flow([funcs]) or _.flow(f, g, …)
Call
What it does
_.flow([funcs]) or _.flow(f, g, …)
Primary signature.
_.flow(...)
Call the util helper.
Prefer import flow from "lodash/flow" when you want a smaller bundle.
Library declarations
Lodash
_.flow([funcs]) or _.flow(f, g, …)
Parameters
Parameter
Description
funcs
Optional. Functions to invoke (array and/or rest args)
Return Value
Return Value
Description
*
New composite function
Lodash Examples
Example 1 — Official: Add, Then Square
Compose _.add and a square helper left to right.
Lodash
function square(n) {
return n * n;
}
var addSquare = _.flow([_.add, square]);
addSquare(1, 2);
// → 9
_.flow is a Lodash Util helper since 3.0.0. It runs anywhere Lodash runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 3.0.0+
_.flow()
Available in [email protected] full builds and the lodash/flow modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 3.0+
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.flowLodash 3.0.0+
Bottom line: Safe for production once Lodash is loaded. Prefer import flow from "lodash/flow" for smaller bundles. Use it for fixed left-to-right transform pipelines.
Frequently Asked Questions
_.flow(...funcs) returns a new function. It runs the first function with your arguments, then each next function with the previous return value — left to right. Official: _.flow([_.add, square])(1, 2) → 9.
As an array (_.flow([f, g])) or as separate arguments (_.flow(f, g)). Both forms work in Lodash 4.
Only the first function. Later steps receive one value — the previous return. Keep steps after the first unary.
flow is left to right (f then g). flowRight is right to left (g then f) — like mathematical compose.
Yes. The composed function uses the this binding of the created function when invoking each step.
Use import flow from "lodash/flow" or require("lodash/flow"). Full build: import _ from "lodash" then _.flow.