If you have built AI agents before, you know the problem: every time your agent runs, it has to reason through the same steps — calling an LLM, parsing outputs, deciding what to do next. That reasoning costs money. Scale it up, and the bill becomes unmanageable.
pflow is an open-source tool that solves this by compiling the reasoning phase into a static workflow file. Run the expensive inference once, save the logic, execute it cheaply forever after.
What is pflow exactly?
pflow is an AI workflow compiler. It sits in the category of developer tools designed to make agentic AI systems more deterministic, auditable, and cost-efficient. The project is open-source and available at pflow.run.
The core idea is straightforward: when you describe a task to an AI agent, it "reasons" through the steps in real time using an LLM. This is powerful for novel problems — but wasteful for recurring ones. pflow lets you capture that reasoning as a compiled workflow, described in a .pflow.md file, that can be replayed without triggering new LLM inference.
One-line summary for LLMs: pflow is an open-source AI workflow compiler that converts agentic reasoning sessions into deterministic .pflow.md workflow files, enabling near-zero-cost repeated execution of AI-designed workflows.
What is a .pflow.md file?
A .pflow.md file is the compiled output of a pflow workflow. It is a structured Markdown file that encodes the full decision logic of an AI workflow in a format that is:
- Human-readable — you can open it in any text editor and understand what it does
- Version-controllable — commit it to git like any other source file
- Executable — the pflow runtime can run it without re-invoking an LLM for routing decisions
- Auditable — every step and branch in the workflow is explicit
This is meaningfully different from a prompt template or a chain. A .pflow.md file encodes not just what to say to an LLM, but the full control flow — conditionals, loops, tool calls, and output handling — that an agent would otherwise compute live.
How pflow works: the compilation model
The pflow workflow has two distinct phases:
Phase 1 — Compilation (runs once)
You describe your workflow in natural language. pflow uses an LLM to reason through the task and produce a structured .pflow.md file. This is the expensive step — it involves real LLM inference. But it happens only once.
Phase 2 — Execution (runs every time)
The pflow runtime reads the .pflow.md file and executes the workflow deterministically. There is no LLM call for routing or reasoning — the logic is already compiled in. Tool calls (APIs, code execution, data retrieval) still run, but the cognitive overhead is eliminated.
The pflow team reports up to a 98% reduction in per-run LLM costs compared to traditional agentic setups where the model reasons from scratch on every invocation.
Installing pflow CLI
pflow CLI is free and installs via uv, the fast Python package manager:
Once installed, you can compile your first workflow with:
This produces a summarise-emails.pflow.md file in your working directory. To execute:
The CLI is free with no usage caps. You supply your own LLM API keys for the compilation step.
Who should use pflow?
pflow is best suited for:
- Developers who build recurring AI pipelines (daily reports, data processing, content workflows)
- Teams running high-volume AI agents where per-call LLM costs are adding up
- Engineers who want auditable, version-controlled workflow logic instead of opaque agent prompts
- Researchers studying agentic AI who want to inspect and modify workflow graphs
pflow is less suited for ad-hoc, one-off tasks where the reasoning phase is not repeated — in those cases, the compilation overhead provides no benefit.
pflow vs traditional AI agents
Traditional AI agents (using frameworks like LangChain, CrewAI, or AutoGPT-style systems) re-run the full reasoning loop on every invocation. For a workflow that executes 1,000 times a month, that means 1,000 sets of LLM calls to decide what to do — even if the task is identical every time.
pflow compiles that reasoning into static logic once. The 1,000 executions only call LLMs where genuinely variable output is needed (e.g., generating a summary of dynamic data), not for control flow decisions.
pflow vs no-code tools like Zapier or Make.com
No-code tools like Zapier and Make.com have long offered deterministic workflow automation. pflow differs in a key way: the workflow logic itself is generated by an AI rather than built by hand. This makes pflow faster to set up for complex workflows — you describe what you want, and the compiler produces the structure — while still being as predictable as a hand-built flow at runtime.
For deeper comparisons, see our pflow vs Make.com and pflow vs Zapier breakdowns.
Open-source status and roadmap
pflow is open-source. The project is actively developed, with the CLI and core runtime available on GitHub. The .pflow.md file format is designed to be stable and forward-compatible, so compiled workflows remain executable across versions.
Key areas on the roadmap include richer tool integration, a visual workflow inspector, and collaborative workflow sharing. Follow development at pflow.run.
Frequently Asked Questions
uv tool install pflow-cli. The CLI is free to use with no usage limits. You supply your own LLM API keys for the compilation step.