PHPackages                             chatflowphp/automata - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. chatflowphp/automata

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

chatflowphp/automata
====================

Framework-agnostic orchestration engine for single-active finite state machines in PHP.

1.0.1(today)01↑2900%1MITPHPPHP &gt;=8.1CI passing

Since Jun 22Pushed todayCompare

[ Source](https://github.com/chatflowphp/automata)[ Packagist](https://packagist.org/packages/chatflowphp/automata)[ Docs](https://github.com/chatflowphp/automata)[ RSS](/packages/chatflowphp-automata/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (3)Used By (1)

Automata
========

[](#automata)

[![CI](https://github.com/chatflowphp/automata/actions/workflows/ci.yml/badge.svg)](https://github.com/chatflowphp/automata/actions/workflows/ci.yml)[![PHPStan](https://camo.githubusercontent.com/1bc07920f0d36e55c17e1d38b1caa132cc605f51a82b388c962870b9a747b898/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230392d627269676874677265656e2e737667)](https://phpstan.org/)[![PHPUnit](https://camo.githubusercontent.com/bc004f75aacf2d6c71f73022452e7825ae8b775a86bc7c9826a7d07e5ab02279/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f504850556e69742d7465737465642d627269676874677265656e2e737667)](https://phpunit.de/)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Framework-agnostic orchestration engine for single-active finite state machines in PHP.

What It Does
------------

[](#what-it-does)

- Activates one automaton at a time and drives it through discrete `tick()` cycles
- Wraps each cycle with optional middleware
- Dispatches commands and events through a lightweight in-memory message bus
- Emits lifecycle events for activation and applied transitions
- Supports snapshot/restore for shared context and serializable automata state

What It Does Not Do
-------------------

[](#what-it-does-not-do)

- No statechart semantics
- No parallel or multi-active automata runtime
- No built-in persistence transport or async messaging backend

Requirements
------------

[](#requirements)

- PHP 8.1 or newer
- Composer

Installation
------------

[](#installation)

```
composer require chatflowphp/automata
```

Quick Start
-----------

[](#quick-start)

```
