Download the PHP package juststeveking/workflow-engine without Composer

On this page you can find all versions of the php package juststeveking/workflow-engine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package workflow-engine

Workflow Engine

CI Latest Version on Packagist Total Downloads

A signal-driven, step-based workflow engine for Laravel.

Most of the interesting logic in a Laravel application is not a single request. It is a process that unfolds over hours or days, and spends most of that time waiting on something it does not control. A payment provider. A human clicking a link in an email. A cron tick three days from now.

The usual approach is to bolt a few booleans onto a model and let the flow emerge from whatever code happens to fire next. It works for a week. Then the logic ends up smeared across a controller, two listeners, a webhook handler, and a scheduled command, and nobody can answer the only question support ever asks: where is this stuck, and why?

This package lets you model those processes as an ordered sequence of steps. Each step does one thing and then tells the engine what happens next: complete, pause and wait for a named signal, sleep for a while, jump somewhere else in the sequence, or fail. Instances are persisted as database rows, driven forward by queued jobs, and resumed by signals arriving from outside. There is one place that describes the process, and one durable row per run that can answer where it is.

The part I care most about is that the lifecycle is a declarative, enforced state machine rather than a diagram in a doc, so an instance cannot end up in an impossible state. That is the strongest guarantee here, and it has its own page: the state machine.

What it looks like

A workflow is an ordered list of steps. A step does one thing, then tells the engine what happens next:

Start it, and let it wait. No worker is held open, no request is blocked. The instance is a database row parked on a signal:

There are four complete, copy-pasteable workflows in examples/ if you would rather read code than prose.

The mental model

Seven nouns, and they fit on a napkin:

The important detail is what the engine does not do. It never runs your whole workflow in one call. It runs exactly one step, persists the result, and queues a job for the next one if there is more to do. Awaiting and sleeping steps stop entirely until a signal arrives or the wake time passes. Nothing is held open, so a workflow that waits three days costs you a database row and nothing else.

When to reach for it

Reach for it when there is waiting in the process, when you need to know exactly which step an instance is parked on and why it failed, or when you are about to stitch something together from listeners, scheduled jobs, and status columns.

Do not reach for it for a synchronous sequence with no waiting and no failure branching, for pure fan-out event handling (Laravel events are already good at that), or for a single background job that happens to have a few lines in it. A workflow engine earns its keep when the process is long-lived. Otherwise it is ceremony.

Installation

The service provider is auto-discovered and the package loads its own migrations:

If you want to customise the schema or the config, publish them first:

Two tables get created. workflow_instances holds one row per run. workflow_signals is an append-only log of every signal delivered, including buffered ones and timeouts. Configuration lives in config/workflow-engine.php; the configuration reference walks through every key.

Quickstart

1. Define your steps and a workflow

Read the two maxAttempts() values back to back and you can see the design decision in each step. Charging a card is not safe to repeat, so it gets one attempt. Provisioning an account is idempotent on our side, so it gets three. That choice belongs next to the code that makes it, which is why it lives on the step rather than in a config file.

2. Register the workflow

Typically in a service provider's boot():

3. Start an instance and drive it

4. Resume it when the signal arrives

That is the entire loop. Everything else is detail, and it lives in the docs.

Documentation

Full documentation is in docs/. Start here:

Architecture decisions are recorded in docs/adr/.

Requirements

License

The MIT License (MIT). Please see License File for more information.


All versions of workflow-engine with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/bus Version ^12.0 || ^13.0
illuminate/console Version ^12.0 || ^13.0
illuminate/contracts Version ^12.0 || ^13.0
illuminate/database Version ^12.0 || ^13.0
illuminate/queue Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package juststeveking/workflow-engine contains the following files

Loading the files please wait ...