Question
KB-2396 AI Agent Intermittently Fails with EVENT_NOT_FOUND, INVALID_TOOL_RESPONSE, and Input Too Long Errors
Symptoms
AI Agent intermittently fails with various error messages for the same input:
The model returned the following errors: Input is too long for requested model. (Service: BedrockRuntime, Status Code: 400, Request ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)
LLM execution failed: EVENT_NOT_FOUND - No event exists with name: sampleFunctionName
LLM execution failed: EVENT_NOT_FOUND - No event exists with name: $UNUSED
LLM execution failed: INVALID_TOOL_RESPONSE - Required schema field not provided in data tree: reasoning
Expression evaluation error at function a!agent_getRunStepById: org.hibernate.exception.LockAcquisitionException: could not execute statementErrors occur both when running tests in designer and when executing the Agent as part of a process model. The same Agent configuration sometimes succeeds and sometimes fails with these errors.
Cause
The EVENT_NOT_FOUND and INVALID_TOOL_RESPONSE errors are intermittent due to the non-deterministic nature of the LLMs used by Agents. The "Input too long" error occurs when the size of the Agent request exceeds the LLM's capacity to handle it.
Action
- Review and enhance the Agent prompt to be as clear and specific as possible, ensuring the Agent can accurately identify and process the required data.
- Ensure all objects used by the Agent as tools have descriptive, accurate names.
- Add retry behavior to process models that call the Agent to prevent errors from impacting active processes.
- For "Input too long" errors, verify the size of the document inputs and "extraInstructions" variables to ensure they do not exceed the LLM's capacity.
Affected Versions
This article applies to Appian 25.4 and later.
Last Reviewed: September 2026
