Skip to content

What is ExecKernel?

ExecKernel is a PHP library for running processes that can follow different paths depending on the decisions made and the information available at each step. It is designed to be integrated into applications: you can use it to drive a guided form, a product configurator or any other process in which the next step depends on more than a fixed sequence of screens.

Instead of writing the rules that govern the entire journey into your application’s controllers or user interface, you describe the possible paths in a graph. ExecKernel keeps track of where an execution is, evaluates the conditions that apply to the possible transitions and checks whether a requested transition is allowed.

Imagine an online store where a customer has to choose how to receive an order. They can collect it from the store or request home delivery, but delivery is only available in certain areas. Once the customer has made a valid choice, the application needs to show the appropriate collection or delivery instructions.

In ExecKernel, each step or outcome in this process is a node. An edge is a directed connection from one node to another, representing a transition the application can request. The graph defines the initial node (the root) and the nodes where navigation ends (the terminals). Conditions attached to edges can restrict the paths that are available.

A graph branches from Choose delivery method to Collection and Home delivery. The latter requires an address within the delivery area. The engine receives a choice and order data from the application and returns state and options; the application displays collection as available and delivery as unavailable when the address is outside the area.

Illustration of a graph and one possible application interface. The interface is not part of the engine.

A single graph can describe the process for many customers. To execute it for a particular customer, the application starts a session, which represents an individual journey through the graph. The session records the current node, the transitions already taken and the context: data associated with the execution, such as whether the customer’s address is within the delivery area.

When the customer selects an option, the application asks ExecKernel to take the corresponding edge. The engine checks the transition using the session and the graph’s conditions. On success it returns the new state and the data the application needs to continue. A terminal can also carry output data, such as a message with collection instructions.

What the engine does — and what your application does

Section titled “What the engine does — and what your application does”

ExecKernel is responsible for navigation through the graph. Your application remains responsible for its own business operations. In the store example, it is the application that determines whether an address is served, displays the available options, and arranges shipment or collection. Reaching a terminal does not by itself create a shipment or update an order in your database.

This separation means the same process definition can be used by different interfaces. A web application could display buttons for the available transitions, while another consumer could present the options as a series of questions. Both use the same graph rules without having to duplicate the navigation logic in each interface.

ExecKernel supports extensions for situations where built-in conditions or output types are not enough, but you do not need to implement an extension to start using it.

You can embed the engine directly in a PHP application. The PHP package includes a local client for working with graphs and sessions without making HTTP requests. Alternatively, the independent HTTP API runs the engine as a service and allows applications to communicate with it through HTTP, the remote PHP client or the JavaScript and TypeScript SDK.

These integration options use the same execution model. Choose the one that fits how your application is deployed; using PHP locally does not require the HTTP API.

If you want to see a graph in action before installing anything, open Graph basics in the Showcase. Follow different edges and observe how the current node changes until you reach a terminal.

To decide whether this approach fits your application, continue with When to use ExecKernel. If you are ready to try it, see Installation and requirements.