Phlow is a high-performance, scalable, and Low Code flow runtime built with Rust — designed to revolutionize the way you build backends. With Phlow, you can create APIs, automations, and event-driven systems using just YAML, composing logic like building blocks.
Thanks to its modular architecture and clear separation between control and behavior, Phlow lets you orchestrate complex flows without writing code — and when you need more power, just plug in lightweight scripts or Rust modules.
It also comes with native observability powered by OpenTelemetry, giving you full visibility into your flows, modules, and executions. Easily export traces and metrics to Jaeger, Grafana Tempo, or AWS X-Ray, all with simple environment variables.
If you're looking for speed, flexibility, and full insight into your backend — Phlow is the Low Code revolution you’ve been waiting for.
📚 Table of Contents
- 🎯 Philosophy
- 🧱 Example:
main.yamlfor an HTTP Gateway - 🧪 More Examples
- 📦 Packages And Modules
- ⚡ YAML Superpowers
- ⚙️ Install & Uninstall
- 🚀 Running a Flow
- 🌐 Running Remote Projects
- 🔌 Module Types
- 🧠 Creating Your Own Module:
log - 📦 Project Structure
- 📡 Observability
- 🧪 OpenTelemetry + Jaeger (Local Dev Setup)
- 🌍 Environment Settings
- 📜 License
🎯 Philosophy
🧱 1. Radical Modularity
Principle: Each piece must be independent, reusable, and pluggable.
Phlow is designed as a set of decoupled modules. You connect functionalities like LEGO blocks, allowing you to replace or evolve parts without breaking the whole. This promotes maintainability and system flexibility.
🧩 2. Code-Free Composition (Low Code)
Principle: The flow matters more than the language.
Business logic is declared using simple files like YAML. Instead of programming behavior, you compose it. This empowers both developers and analysts to build together, democratizing software creation.
⚙️ 3. High-Performance Runtime
Principle: Performance is not a detail — it's architecture.
Phlow is built in Rust, ensuring memory safety, low resource consumption, and blazing speed. It runs anywhere — locally, on the edge, or in the cloud — with minimal latency and maximum scalability.
📦 4. Automatic Module Installation
Principle: The user experience should be instant.
Phlow detects the required modules and automatically downloads them from the official phlow-packages repository. Everything is installed locally under ./phlow-packages, with no manual setup or external dependencies.
🔍 5. Observability by Design
Principle: You can only improve what you can observe.
Every flow and module is traceable with logs, metrics, and spans via OpenTelemetry. Real-time tracking with Jaeger, Grafana, or Prometheus is built-in. Transparency and traceability are part of the system’s DNA.
🧱 Example: main.yaml for an HTTP Gateway
main: gateway
modules:
- name: gateway
module: rest_api
version: latest
with:
host: 0.0.0.0
port: 3000
- name: request
version: latest
module: http_request
with:
timeout: 29000 # 29s
steps:
- condition:
assert: main.path.start_with("/public")
then:
module: request
input:
method: main.method
url: `public-service.local${main.uri}?`
headers:
x-forwarded-for: main.client_ip
x-original-path: main.path
body: main.body
- use: authorization
id: auth
input:
api_key: main.header.authorization
- condition:
assert: steps.auth.authorized == true
then:
module: request
with:
method: main.method
url: `private-service.local${main.uri}?`
headers:
x-forwarded-for: main.client_ip
x-original-path: main.path
body: main.body
- return:
status_code: 401
body:
🧪 More Examples
To explore additional use cases and see Phlow in action, check out the examples/ folder at the root of this repository.
You'll find ready-to-run flows for:
- HTTP gateways
- Task automation
- External API integration
- Using
phsandrhaiscripts - Full observability with spans and logs
Clone, run, and experiment — Phlow is made to get you flowing in minutes. 🚀
📦 Packages and Modules
Automatic Module Download
Phlow automatically downloads the modules specified in your flow configuration.
The official module repository is phlow-packages, which contains all official Phlow modules precompiled for Linux.
When you run Phlow, it will automatically fetch and install the required modules into a local phlow-packages/ folder at the root of your project execution.
You don’t need to worry about building or installing them manually — just describe the modules in your YAML, and Phlow takes care of the rest.
Using modules
To use a module in your flow, you only need to declare it under the modules section and reference it in your steps.
Here’s a minimal working example that uses the official log module:
main: log_example
modules:
- module: log
version: latest
steps:
- module: log
input:
level: info
message: "📥 Starting process..."
- module: log
input:
level: debug
message: "'Current time: ' + timestamp()"
- module: log
input:
level: error
message: "❌ Something went wrong"
⚡ YAML Superpowers
Phlow extends YAML with:
!eval: execute inline expressions using Phlow Script (phs).!include: include other YAML files into the flow tree.!import: import external script files (.phs or .rhai) and evaluate them with!eval.
⚙️ Installation & Uninstall
You can easily install or uninstall Phlow using our ready-to-use shell scripts.
🔽 Install via curl
|
🔽 Install via wget
|
🧹 Uninstall via curl
|
🧹 Uninstall via wget
|
These scripts will install or remove the phlow binary from /usr/local/bin. The install script fetches the latest release and makes it globally available on your system.
🚀 Running a Flow
By default, Phlow will look for a `main.yaml` in the current directory:
To run a specific file:
If you provide a directory path and it contains a `main.yaml`, Phlow will automatically run that:
# → runs path/to/directory/main.yaml
🆘 Help
For all available options and usage info:
# or
🌐 Running Remote Projects
Phlow supports running remote projects directly from URLs or Git repositories. You can pass a .git, .zip, or .tar.gz source — Phlow will automatically download, extract (if needed), and execute the flow from a main.yaml.
# Git via SSH
# Git via HTTPS
# ZIP archive
# Tarball (GZIP)
🪄 Git branch selector
🔐 Custom SSH Key
By default, Phlow uses the SSH key at ~/.ssh/id_rsa to authenticate Git over SSH. To override this path, set the environment variable:
🔐 Authorization Header for ZIP/GZIP Downloads
When downloading .zip or .tar.gz files that require authentication (e.g., from a private server), you can use the environment variable below to send an Authorization header in the request:
Phlow will include this header when performing the HTTP request for ZIP or GZIP downloads.
🗂️ Inner directory selector (ZIP/GZIP)
If you are downloading a ZIP or GZIP archive and want to specify which folder inside the archive contains your flow, you can add #folder_name at the end:
📁 Auto-detection of inner folder
If you don’t specify a folder name and the ZIP/GZIP file contains only one directory, Phlow will automatically treat it as the root and search for a main.yaml inside it.
If the archive contains multiple folders or any loose files in the root and no folder is specified, Phlow will return an error.
🔌 Module Types
| Type | Purpose |
|---|---|
main module |
Entry point. Starts the app (HTTP, CLI, AMQP, etc). |
step module |
Logic executed within a flow (log, fetch, transform, etc). |
Step modules can also be executed directly from Phlow Script (PHS), making it easy to use simple modules inside .phs or .rhai files.
📄 Example: Step Module with Phlow Script (PHS)
main.yaml
main: cli
name: Example Cli
version: 1.0.0
description: Example CLI module
author: Your Name
modules:
- module: cli
version: latest
with:
additional_args: false
args:
- name: name
description: Name of the user
index: 1
type: string
required: false
- module: log
version: latest
steps:
- return: script.phs
script.phs
log;
"phs"
To execute this file, just run:
This will evaluate the imported .phs file and run the steps using the declared modules.
ℹ️ Note: In Phlow Script (PHS), function calls respect the order of parameters defined in the module's package. For example, if your
phlow.yamlfor thelogmodule defines inputs like:input: type: object required: true properties: level: type: string description: The log level (e.g., info, debug, warn, error). default: info required: false message: type: string description: The message to log. required: trueThen the correct function signature in
.phsis:log(level, message)because the parameter order defined in
propertiesis preserved and required by the execution engine.
🧠 Creating Your Own Module: log
Phlow modules are written in Rust and compiled as shared libraries. Here’s a real example of a simple log module that prints messages at various log levels.
🔧 Code (src/lib.rs)
use __tracing_subscriber_SubscriberExt;
use SubscriberInitExt;
use Layer;
use ;
create_step!;
pub async
🛠️ Example usage in a flow
steps:
- module: log
input:
level: info
message: "Process started"
- use: log
input:
level: error
message: "something went wrong: " + main.error
📦 Project Structure
All compiled .so modules must be placed inside the phlow_packages/ directory.
To build all modules at once, this project includes a utility script:
📡 Observability
Phlow integrates with:
- OpenTelemetry (OTLP)
- Tracing (Spans and Logs)
- Prometheus Metrics
- Jaeger, Grafana Tempo, AWS X-Ray
Enable it with:
PHLOW_OTEL=true
PHLOW_LOG=DEBUG
PHLOW_SPAN=INFO
🧪 OpenTelemetry + Jaeger (Local Dev Setup)
To enable observability with Jaeger during development, you can run a full OpenTelemetry-compatible collector locally in seconds.
🔄 1. Run Jaeger with OTLP support
This container supports OTLP over HTTP and gRPC, which are both compatible with Phlow's OpenTelemetry output.
⚙️ 2. Configure environment variables
Set the following environment variables in your shell or .env file:
🔍 3. Open the Jaeger UI
Once running, access the Jaeger web interface at:
Search for your service using the name defined in OTEL_SERVICE_NAME.
✅ Tips
- Combine this with
PHLOW_OTEL=true,PHLOW_SPAN=INFO, andPHLOW_LOG=DEBUGfor full observability. - You can also integrate with Grafana Tempo or AWS X-Ray by replacing the collector backend.
🌍 Environment Settings
Below is a list of all environment variables used by the application, combining those defined in both files, along with their descriptions, default values, and types.
Environment Variables Table
| Variable | Description | Default Value | Type |
|---|---|---|---|
| PHLOW_PACKAGE_CONSUMERS_COUNT | Number of package consumersDefines how many threads will be used to process packages. | 10 |
i32 |
| PHLOW_MIN_ALLOCATED_MEMORY_MB | Minimum allocated memory (MB)Defines the minimum amount of memory, in MB, allocated to the process. | 10 |
usize |
| PHLOW_GARBAGE_COLLECTION_ENABLED | Enable garbage collectionEnables or disables garbage collection (GC). | true |
bool |
| PHLOW_GARBAGE_COLLECTION_INTERVAL_SECONDS | Garbage collection interval (seconds)Defines the interval at which garbage collection will be performed. | 60 |
u64 |
| PHLOW_LOG | Log levelDefines the log verbosity for standard logging output. Possible values typically include TRACE, DEBUG, INFO, WARN, ERROR. |
WARN |
str |
| PHLOW_SPAN | Span levelDefines the verbosity level for span (OpenTelemetry) tracing. Possible values typically include TRACE, DEBUG, INFO, WARN, ERROR. |
INFO |
str |
| PHLOW_OTEL | Enable OpenTelemetryEnables or disables OpenTelemetry tracing and metrics. | true |
bool |
Notes
- If an environment variable is not set, the default value indicated in the table above will be used.
- Set the corresponding environment variables before running the application to override the defaults.
- The log level (
PHLOW_LOG) and span level (PHLOW_SPAN) control different layers of logging:PHLOW_LOG: Affects standard logging (e.g., error, warning, info messages).PHLOW_SPAN: Affects tracing spans (useful for deeper telemetry insights with OpenTelemetry).
- The
PHLOW_OTELvariable controls whether or not OpenTelemetry providers (for both tracing and metrics) are initialized.
📜 License
MIT © 2025 — Built with ❤️ and Rust.