Debugging and troubleshooting
Troubleshooting starts with an observable symptom: an option remains unavailable, a session cannot be recovered, or a notification does not reach another service. The next step is to identify which part of the integration can explain it. The graph defines the route and conditions; the engine evaluates them; a store or API retains the session; your client presents a view; external delivery has its own outcome.
Work from that evidence toward one correction, then check the behavior again. A successful graph transition does not establish that a webhook finished its business work, and an unchanged client view does not establish that the backend rejected a request.
Start with the layer that can answer the question
Section titled “Start with the layer that can answer the question”| Symptom | First useful check | Next action |
|---|---|---|
| The graph will not load. | Validate the exact definition and record the loader’s code and location. | Correct the definition, then load it again. |
| A choice is unavailable or rejected. | Inspect the current node, edge, conditions and trusted context for that session. | Correct the input or definition if it is wrong; otherwise explain the rejection to the user. |
| The interface still shows an earlier node. | Recover the known session ID from the authoritative backend. | Rebuild the view from that response before deciding whether another operation is needed. |
| The API cannot find the session. | Check the ID, deployment, store, expiration and deletion history. | Recover from appropriate retained data if available, or handle the missing session explicitly. |
| A request is denied or limited. | Preserve its HTTP status, response body and request identity; identify the responding layer. | Review API configuration, access and rate limiting. |
| The graph completed but the webhook is missing. | Follow event publication, listener selection, queueing or HTTP dispatch, then the receiver. | Repair the failed stage and decide whether the same delivery can be retried safely. |
| A request is slow. | Separate execution, persistence, delivery waits and HTTP handling. | Measure the relevant operation using Performance and benchmarking. |
Keep a small, useful incident record
Section titled “Keep a small, useful incident record”Keep enough information to reproduce or correlate the problem without turning every incident into a full state dump:
| Information | Why it helps |
|---|---|
| Operation and time | Distinguishes a start, choice, recovery or external delivery and places it in order. |
| Session ID, when known | Identifies the session to query in the correct backend. |
| Graph code and revision | Identifies the definition that the session should use. |
| Current node and selected edge | Shows the intended transition and whether the edge belongs to that node. |
| Public error code and relevant HTTP status | Identifies the reported failure at that interface. |
| Request or operation correlation IDs | Helps connect records from the client, API and runtime. |
| Delivery identity, for a webhook | Connects the notification to attempts and receiver records. |
These identifiers have different jobs. Keep their association when your application knows it instead of treating a session ID as the identity of every request in that session. Logging and audit trails and Tracing and error telemetry explain the available records and correlation.
Keep credentials and unnecessary personal data out of shared diagnostics. A private state copy can be useful for a local investigation, but it may contain business context that should not enter a general log or support message. Record the fields needed for the question and retain the complete artifact only in the environment where it is appropriate to inspect it.
An option is blocked
Section titled “An option is blocked”We will reuse the learning-choice example from Anatomy of a graph. At node 10, edge 101 selects a reading guide and reaches terminal 20; edge 102 selects practice and reaches terminal 30. Practice requires practiceEnabled: true.
Suppose the application shows practice as unavailable. Begin with the state it is actually using: is the current node 10, and is the trusted context value false? The correct behavior for that input is to keep practice blocked. Repeating the same request will not change the condition.
Inspect a state copy without choosing an edge
Section titled “Inspect a state copy without choosing an edge”The source checkout includes bin/ek-debug, a local diagnostic tool. It reads a graph and a serialized SessionState, then previews one edge at a selected logical time. It does not save a session or send the choice to your API. Unlike execkernel, it is not listed as a Composer-installed binary; invoke it from the source checkout with its dependencies available.
For this example, use the learning graph and the demonstration state. The state was produced by starting that graph in the local engine with practiceEnabled: false. It is at node 10, with logical time 1700000000.
With those two files in the checkout root, run:
php bin/ek-debug condition \ --graph=learning-path.json \ --state=debug-learning-state.json \ --edge=102 \ --timestamp=1700000000--graph supplies the exact definition and --state supplies the state to inspect. For your own incident, serialize a copy of the authoritative SessionState with toArray(); the input is that state object, not a complete HTTP response or a presentation snapshot. Check the graph identity and revision before interpreting the result.
--edge selects the choice under investigation. --timestamp fixes the time seen by the preview; if omitted, the tool uses the state’s updated_at. This matters when rules depend on time. Inspecting an old state at a different time can answer a different question from the one your application originally asked.
These fields were returned by the command:
{ "edge_id": 102, "allowed": false, "rule": "context_value", "reason": "context_value_failed", "ek_code": "EK-RULE-003", "availability": "blocked", "timestamp": 1700000000, "timestamp_source": "explicit", "scope": "isolated_read_only_preview", "effects_executed": false, "context_redacted": true}The preview identifies the failed context condition. It leaves the graph and state files unchanged and performs no transition. Exit code 0 means the diagnostic observation was produced successfully; it does not mean the edge was allowed.
The full response also contains navigation. Read it alongside the top-level condition result. Conditions can pass while navigation rejects the edge because it belongs to another node, the current node is terminal or another navigation check applies. The selected edge must satisfy both parts for the preview to show it as available.
Correct the cause, then check the application
Section titled “Correct the cause, then check the application”If practiceEnabled: false is correct, keep the option unavailable and explain the requirement in the interface. If the application should have enabled practice, investigate how it obtained that trusted value and correct that source. Then submit the appropriate context through the normal application operation and read the resulting state.
Do not treat editing a diagnostic state file as a backend repair. The local tool examines a copy; changing it does not update the stored session and should not bypass the application’s decision about who may use practice.
The debugger creates an isolated evaluator. It does not recreate your custom rule registry, plugins, event bridges, store or sandbox configuration. A missing custom handler in that environment is not proof that the configured production handler fails. For those cases, reproduce the operation in a controlled instance of your application’s actual integration and use its bounded diagnostics.
By default, the tool removes context details from its output. --include-context opts into fuller local diagnostics; use it only where those values can be inspected safely. This output handling does not turn the original input state file into a sanitized artifact.
For the application’s recovery behavior after a rejected choice, continue with Rejected transitions and error recovery.
A session cannot be recovered
Section titled “A session cannot be recovered”For an API integration, first verify the stored session ID and the API deployment your application is contacting. A client-side snapshot can still exist after the server-side session has expired or been removed. Reconstructing that snapshot does not test the current backend record.
Using the existing connection described in HTTP API integration, query the session through resume. Here EXECKERNEL_BASE_URL and EXECKERNEL_API_TOKEN are your configured connection, and SESSION_ID is the ID retained by your application:
curl --request POST \ "$EXECKERNEL_BASE_URL/execkernel/session/resume" \ --header "Authorization: Bearer $EXECKERNEL_API_TOKEN" \ --header 'Content-Type: application/json' \ --data "{\"session_id\":\"$SESSION_ID\"}"A successful response contains the authoritative state and a rebuilt payload. If the response says that the session is missing, record that before deciding what to do. In the standalone API, trying to resume a removed session produced HTTP 400 with these error fields:
{ "error": { "code": "EK-INPUT-400", "message": "Session not found." }}That response does not by itself distinguish a mistyped ID, another deployment, expiration or an intentional deletion. Check the surrounding evidence:
| Check | What the answer changes |
|---|---|
| Does the ID match the one returned at start? | Correct an application identity mismatch before creating another session. |
| Is this the same deployment and storage location? | Correct routing or configuration if the application is querying a different backend. |
| Was the record expired or deleted? | Apply the application’s retention and missing-session behavior. |
| Did the storage survive the service restart? | Check the selected store and persistent volume. |
| Is there a verified backup covering the required data? | Follow the isolated recovery procedure before deciding whether restoration is appropriate. |
Session stores explains store lifetime, and Expiration, history and retention explains the lifecycle decisions. For the Docker API, use SQLite backup, recovery and health checks to test recovery in a separate instance.
A healthy service can still lack this particular session. Check both the service’s readiness and the specific session your application needs. If the state is present but rejected against another graph revision, investigate Graph identity and versioning before changing stored data.
If the original start response was lost and your application never received an ID, this API does not provide a client-chosen idempotency key or a lookup route that reconstructs that missing response. Client errors, transport and diagnostics explains the difference between recovering a known session and handling an uncertain start.
A webhook does not arrive
Section titled “A webhook does not arrive”We will reuse the review notification from Configuring webhooks: graph review-notice reaches terminal 20 through edge 101 and notifies another service about reference REQ-42. The graph result and the notification’s delivery are separate observations.
Follow the notification through the integration in this order:
- Check the graph result and event publication. Confirm which transition completed and whether your persistence integration published its deferred events after the save. An accepted state that has not had its event batch published cannot yet demonstrate listener delivery.
- Check the subscription and listener. Verify that the application attached the webhook listener and that the event, graph and recipient configuration select the intended destination.
- Check the selected dispatcher. A direct dispatcher attempts HTTP delivery before returning.
AsyncWebhookDispatchercalls the configured queue’senqueue(); another part of your application must process the queued work. - Check the final delivery observation. The listener’s optional
failureObserverreports a failed dispatch withdelivery_id,eventandexception. Use that identity to inspect the relevant receiver or processor records. - Check receiver acceptance and business processing. An HTTP
2xxestablishes HTTP acceptance under the dispatcher’s contract. The receiving application still determines when its business work is complete.
The delivery guide’s controlled receiver demonstrates an initial 503 followed by 200. Both requests carry the same delivery identity. With only one allowed attempt, the same receiver leaves the graph at terminal 20 while the listener reports delivery failure. This gives your application enough information to distinguish “review complete” from “notification accepted.”
The failure observer is called after the dispatch fails, not for each intermediate retry. Its absence is not a complete attempt history. For a queued dispatcher, an accepted queue insertion is also not confirmation that the HTTP request was sent. Check the processor and the queue’s actual persistence and acknowledgement behavior.
If a request timed out, the receiving service may already have processed it. Before resending, consult the receiver’s evidence or retry the same stored delivery through a receiver that handles duplicate identities. Constructing a fresh notification can create a new delivery identity. The delivery, retries and queues guide develops that recovery decision.
Verify the correction at the same scope as the symptom
Section titled “Verify the correction at the same scope as the symptom”After correcting the relevant configuration or data source, repeat the operation that demonstrates the fix and inspect its outcome. For a blocked choice, check the accepted or deliberately rejected transition and the resulting view. For a recovered service, retrieve a known session. For a notification, verify the level of acknowledgement your application requires.
Keep the original symptom, the evidence used, the change and the observed result together. If the symptom remains, move to the next unresolved layer rather than broadening the change without a new reason. Use Error codes and exceptions for lookup once the failing interface has been identified.