PHPackages                             xavante/core - 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. xavante/core

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

xavante/core
============

Core library for Xavante projects

00[2 issues](https://github.com/xavante-workflow/core/issues)PHP

Since Oct 27Pushed 4mo agoCompare

[ Source](https://github.com/xavante-workflow/core)[ Packagist](https://packagist.org/packages/xavante/core)[ RSS](/packages/xavante-core/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (9)Used By (0)

[![Xavante Workflow Engine](banner-xavante.png)](banner-xavante.png)

Xavante Workflow Engine
=======================

[](#xavante-workflow-engine)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![PHP Version](https://camo.githubusercontent.com/7535257ca228724c93658bd52583d4e47a9bab02c356abf6e54c1d575f2151e6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c75652e737667)](https://www.php.net/)[![PHPUnit](https://camo.githubusercontent.com/5e58ff7cfdd4b6b5c5161ba72482fee2b3ebd69199c86d37e7d11d64c92cc5c4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54657374696e672d504850556e697425323031312e352d677265656e2e737667)](https://phpunit.de/)

**Xavante** is a powerful, self-contained PHP workflow engine library for modeling, testing, and executing versioned workflows. Built with a focus on deterministic state machines, JSON-first serialization, and comprehensive testing capabilities.

🌟 Why Xavante?
--------------

[](#-why-xavante)

Originally conceived in 2005 and presented at a technology event in Brazil, Xavante began as an experimental effort to build a compact, deterministic workflow engine. After a long pause, development was resumed in 2024: the revival preserves the original name and core concepts while focusing on modernization — updating the codebase for modern PHP (8.2+), adding Docker-based development, expanding automated tests, and clarifying the dual-model architecture, factory patterns and operator system. The 2024 effort started as an individual initiative by the original author and is intended to grow into a community-driven project; contributors and volunteers are welcome to help improve features, documentation, and the broader ecosystem (dashboard, worker, designer, API).

**Empowering Applications with User-Configurable Workflows**

The main purpose of the Xavante workflow engine is to enhance application capabilities by offering custom functionalities that don't necessarily require building code components to make them work. This reduces dependency on developers and enables users to create their own flows within the capabilities offered by target applications.

**Real-World Benefits:**

- **CRM Applications**: Instead of maintaining huge backlogs of automation features, engineering teams can provide workflow templates that perform operations according to business design
- **Flexible Versioning**: Create different versions with varying characteristics, or remove parts of flows by simply modifying templates
- **End-User Empowerment**: Applications can allow end users to modify workflow parts, adding extra flexibility to projects
- **Framework Agnostic**: Works seamlessly with any PHP framework (Laravel, Symfony, CodeIgniter) or as standalone scripts
- **Reduced Development Overhead**: Business logic changes don't require code deployments—just template updates

📖 About the Name
----------------

[](#-about-the-name)

This project is named **Xavante** ("sha-VAHN-chee") as a tribute to the strength, structure, and resilience of the Xavante people of Brazil. Despite enduring persecution and displacement, they preserved their identity, traditions, and wisdom. Their dual clan system, sacred decision-making spaces, and powerful initiation rituals reflect a deep cultural logic—rooted in balance, endurance, and community.

By choosing this name, I hope to honor their memory and legacy, and acknowledge the strength of Indigenous knowledge systems that continue to inspire, even in the world of modern technology. This is a gesture of respect—for a people whose cultural richness deserves to be remembered and celebrated.

🎯 Framework Integration
-----------------------

[](#-framework-integration)

Xavante Core is designed to integrate seamlessly with any PHP environment:

- **Laravel/Lumen**: Service provider and facade support
- **Symfony**: Bundle integration with dependency injection
- **CodeIgniter**: Library integration with CI hooks
- **Standalone Scripts**: Direct composer autoloading
- **Legacy Applications**: Drop-in compatibility with existing codebases

🚀 Features
----------

[](#-features)

- **Dual Model Architecture**: Immutable workflow templates and stateful runtime instances
- **JSON-First Design**: Complete serialization/deserialization of workflows
- **Deterministic State Machines**: Guards, conditions, and role-based transitions
- **Comprehensive Action System**: Entry/exit/transition tasks with retry policies
- **Rich Operator Library**: 20+ operators for conditions and guards
- **Factory Pattern**: Type-safe object creation with validation
- **Docker Development**: Containerized development environment
- **Extensive Testing**: Unit, integration, and use-case test suites

📦 Installation
--------------

[](#-installation)

```
composer require xavante/core
```

🏗️ Architecture Overview
------------------------

[](#️-architecture-overview)

### Core Components

[](#core-components)

```
┌─────────────────────────────────────────────────────────────┐
│                    Xavante Workflow Engine                   │
├─────────────────────────────────────────────────────────────┤
│  Domain Models (Templates)     │  Runtime Models (Instances) │
│  ├── Workflow                  │  ├── Process                │
│  ├── State                     │  ├── ProcessHistory         │
│  ├── Transition               │  └── RuntimeContext         │
│  ├── Event                    │                             │
│  └── Variable                 │                             │
├─────────────────────────────────────────────────────────────┤
│                     Execution Engine                         │
│  ├── Processor (State Machine Engine)                       │
│  ├── Actions (Entry/Exit/Transition Tasks)                  │
│  └── Conditions (Guards & Operators)                        │
└─────────────────────────────────────────────────────────────┘

```

### Dual Model Architecture

[](#dual-model-architecture)

**Domain Models** (`src/Models/Domain/`)

- **Immutable workflow templates** that define the structure
- `Workflow`: Container with states, transitions, events, variables
- `State`: Nodes with entry/exit tasks and type (initial/intermediate/final)
- `Transition`: Event-triggered edges with guards and source→target states

**Runtime Models** (`src/Models/Runtime/`)

- **Stateful execution instances** that track running workflows
- `Process`: Running workflow instance with active states, variables, history
- Maintains execution context and audit trail

🎯 Quick Start
-------------

[](#-quick-start)

### 1. Create Your First Workflow

[](#1-create-your-first-workflow)

```
