Architecture and components
ExecKernel’s engine is a PHP library. Your application can run it in its own PHP process or send requests to a separate HTTP API that runs it on the server. The SDKs provide clients for these integrations: PHP supports both local and remote execution, while the JavaScript and TypeScript SDK uses the HTTP API.
The choice determines where you make graphs available and keep session state. The engine’s job remains the same in both cases: check the requested move through a graph and return the resulting state and data for your application.
What the engine works with
Section titled “What the engine works with”A graph defines a process: its steps, the connections between them and any conditions on those connections. A session represents one execution of that process. It records the current step, the data used in decisions and the path taken so far. Several sessions can follow the same graph independently.
To advance a session, your application identifies the connection it wants to follow, called an edge. The engine evaluates that choice against the graph and the session’s data. If it accepts the choice, it returns the new state together with a payload: data describing the current step, its options or a terminal result that your application can present.
The engine needs the graph and session state to perform that work. Loading them and saving the result are responsibilities of the integration around it.
Execution inside your PHP application
Section titled “Execution inside your PHP application”The local PHP SDK coordinates those operations within your application’s PHP process. Its configured graph loader supplies the definition, and its session store reads and saves each session’s state.
Consider an application that displays several choices and receives one selection. It passes the selected edge and the session identifier to the local SDK. The SDK loads the graph and saved state, asks the engine to evaluate the choice, and saves an accepted advance before returning the result. Your application can then update the screen from that result.
This is a good starting point when the application that manages the process already runs in PHP. You configure access to graphs and session storage there; you do not need a separate ExecKernel API service.
You can also embed the engine directly, using its PHP interfaces, factory and facade. This gives your application control over that coordination. The facade helps load the graph and call the engine; your application remains responsible for preserving the resulting session state.
Execution through the HTTP API
Section titled “Execution through the HTTP API”In a remote integration, the API service runs the PHP engine and has access to the graphs and stored sessions. Your application communicates with that service using the remote PHP SDK, the JavaScript and TypeScript SDK, or an HTTP client.
Follow the same selection in this arrangement. Your application sends the session identifier, the selected edge and any relevant data over HTTP. The API retrieves the session and its graph, calls the engine, saves an accepted advance and returns the result in its response. The SDK makes that response available to your application.
Graphs must therefore be available to the API service. When starting a session, your application identifies a graph from the server’s catalogue. When continuing it, the API retrieves the graph associated with that session. The client does not need its own copy of the definition to make a choice.
Choose this arrangement when a JavaScript application needs ExecKernel, or when you want execution and session storage behind a service boundary. A PHP application can use it for the same reason. The JavaScript SDK is an HTTP client; the PHP engine still runs on the server.
Choose an integration
Section titled “Choose an integration”| Your application needs to… | Continue with… |
|---|---|
| Run ExecKernel locally with graph loading and session storage coordinated by the SDK. | Local PHP SDK |
| Coordinate direct calls to the PHP engine and manage the resulting state itself. | Embedding the engine · Factory and Facade |
| Use an ExecKernel API service from PHP. | Remote PHP SDK |
| Use an ExecKernel API service from JavaScript or TypeScript. | JavaScript and TypeScript SDK |
To understand how the definition and each session relate during execution, see the graph-based execution model.