Flows Components
To take full advantage of Lunar.dev Flows' capabilities, you'll need to understand its core elements.
Lunar.dev Flows use a modular framework, allowing for precise control over API traffic. API Streams, both requests and responses, are segmented into sub-streams using filters based on parameters like URL, HTTP method, or headers. This segmentation ensures focused traffic management.
Processors operate on streams, performing tasks such as rate limiting, modifying traffic, or generating responses. Flows are collections of processors connected in sequence through from and to definitions, creating flexible traffic control pipelines.
This modular approach allows flows to call other flows, enabling scalable, customizable API management that adapts to evolving traffic needs. By structuring traffic into reusable components, Lunar.dev Flows ensure efficient, secure, and adaptable API consumption strategies.
📄️ Flow Stream Filter
An API stream represents the traffic flow, either in API requests or API responses. These streams are divided into two main types:
📄️ Flow Graph Structure
A flow in Lunar.dev is a structured collection of processors working together to manage API traffic. Flows define how requests and responses are processed, with each flow represented in a yaml file. This modular setup allows you to precisely control traffic by processing API requests and responses in real-time.
📄️ Flow Configuration Template
Flows are YAML configurations that define how the Lunar.dev Gateway should handle requests—from matching incoming paths to applying logic like rate limiting, tool invocation, or response shaping. Each flow combines filters, processors, and a routing graph to control how requests and responses move through the system.