Download the PHP package helvetitec/flowengine without Composer

On this page you can find all versions of the php package helvetitec/flowengine. 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 flowengine

Helvetitec FlowEngine

FlowEngine is a small Laravel package for building stateful, resumable flows such as conversations, onboarding journeys, and application workflows.

A flow receives an input, handles the subject's current state, updates its state or context, and persists when execution stops. Each subject can have multiple independent FlowRun records.

Requirements

Laravel discovers the package service provider through Composer package discovery.

Installation

Install the package with Composer:

If your application uses Laravel Boost, its boost:install and boost:update commands automatically include FlowEngine's package-specific AI guidelines.

Publish the migration and run it:

The migration creates flow_runs, including a polymorphic subject, the flow class, current state, JSON context, cooldown, and active flag.

Quick start

Add HasFlowRuns to an Eloquent model that will own flows:

Create a flow by extending FlowEngine. The doRun method is called with the current input. Use the subject and helper methods to implement state transitions:

Start and run the flow from a controller, job, event listener, or webhook:

startFlow creates the run without executing it. This is useful when context must be prepared first:

Pass force: true to run a flow even when its run is inactive or has a future cooldown:

When to use a custom FlowEngine

FlowRun should normally be preferred because it is the default Eloquent implementation and works well for flows owned by a model, such as a Chat. It is not the right fit when a flow has no model owner at all, for example a system-wide import or a temporary session that is not linked to a Chat or another Eloquent model.

In those cases, a custom FlowEngine can run against any application-owned class that implements FlowSubject. The subject below deliberately returns null from getOwner() and persists its state outside flow_runs:

The custom subject owns its lifecycle and persistence; FlowEngine still handles cooldown checks, exceptions, stopping, and the flow helpers. Use this approach only when FlowRun cannot represent the flow's ownership or persistence model. Otherwise, use HasFlowRuns and FlowRun.

Core concepts

Flow states

Every new run starts in the start state. transition changes the state for the next run. transitionAndStop changes the state and persists immediately.

Context

Context is a nullable associative array stored as JSON on the flow_runs row:

Use broadcastContext on a model to merge the same values into every flow run:

Cooldowns and lifecycle

A future cooldown prevents a normal run. The cooldown is cleared automatically once it has expired:

Use stop(persist: false) only when the changes made during the current execution should not be saved. stop() persists by default. Exceptions raised by a flow are wrapped in FlowEngineException with flow and subject context.

API summary

FlowEngine

HasFlowRuns

FlowRun

FlowRun is the default Eloquent implementation of FlowSubject. It provides resolveFlow, runFlow, mergeContext, and cleanup helpers:

Rules of thumb

  1. Implement flow logic in doRun; do not call it directly.
  2. Stop after handling an input so state and context are persisted.
  3. Keep flow state in the run's state key and durable, small values in context.
  4. Use force: true deliberately; it bypasses active and cooldown checks.
  5. Keep side effects (messages, notifications, external calls) in the flow's state handlers.

Development

Install dependencies and run the available static analysis command:

License

This package is open-sourced software licensed under the MIT license.


All versions of flowengine with dependencies

PHP Build Version
Package Version
No informations.
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 helvetitec/flowengine contains the following files

Loading the files please wait ...