Download the PHP package projectsaturnstudios/pocketflow-php without Composer
On this page you can find all versions of the php package projectsaturnstudios/pocketflow-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download projectsaturnstudios/pocketflow-php
More information about projectsaturnstudios/pocketflow-php
Files in projectsaturnstudios/pocketflow-php
Package pocketflow-php
Short Description PHP implementation of The-Pocket/PocketFlow — minimal graph workflow orchestration.
License MIT
Informations about the package pocketflow-php
PocketFlow PHP
Minimal graph workflow library for PHP — a port of The-Pocket/PocketFlow.
- Nodes with
prep→exec→post - Flows that route on action strings (
default,continue, …) - Shared state bag mutated across hops (Flows clone nodes; put durable data in
$shared) - Async via ReactPHP Promise (
AsyncNode/AsyncFlow) - Batch helpers for list and parallel fan-out
Package: projectsaturnstudios/pocketflow-php
Namespace: ProjectSaturnStudios\PocketFlow\
Requirements
- PHP 8.4+
react/promise(required for async APIs; syncFlow/Nodedo not need an event loop)
Install
Quick start (sync)
Conditional edges
Self-loop
Async
Array $shared values are wrapped in a SharedStore for the async run so mutations persist across promise hops, then copied back into your array when the promise settles.
Nested AsyncFlow graphs work: AsyncFlow extends AsyncNode, matching the Python MRO intent.
Batch
BatchNode/BatchFlow— sequential items / param setsAsyncBatchNode/AsyncParallelBatchNode— sequential vsPromise\allAsyncBatchFlow/AsyncParallelBatchFlow— batch orchestration
Public API notes
| Method | Role |
|---|---|
Node::run(&$shared) |
Run a single node (warns if successors exist — use Flow) |
Flow::run(&$shared) |
Orchestrate from the start node |
AsyncNode::run_async(&$shared) / AsyncFlow::run_async(&$shared) |
Promise-based entry |
post / post_async return value |
Action key for the next successor (default if null/non-string) |
Retries: Node / AsyncNode honor max_retries and wait (seconds) via _exec.
Tests
CI runs Pest on PHP 8.4.
Comparison with Python PocketFlow
| Feature | Python | This package |
|---|---|---|
| Graph + action routing | Yes | Yes |
| Shared mutable store | dict | array / SharedStore |
| Async | asyncio | ReactPHP Promise |
| Batch / parallel batch | Yes | Yes |
License
MIT — same spirit as the original PocketFlow.
Acknowledgments
- The-Pocket/PocketFlow — original design
- ReactPHP — promises for async nodes