Scenario
By default, Enneo carries out the automatic execution (background processing) of AI agents only for the first incoming email of a ticket and only when exactly one AI agent has been identified. The standard background processing therefore does not apply in two situations:- Multiple AI Agents Recognized: A customer raises multiple concerns in one email, e.g., a cancellation and a revocation. Enneo recognizes both AI agents, but for security reasons does not automatically execute either.
- Sequential Replies: A customer replies again to an existing ticket. AI processing does occur (tags, AI agent recognition, parameter extraction), but automatic execution is not triggered again.
Possible Solution
An Event Hook responds to incoming tickets or customer responses, checks the recognized AI agents, and triggers the automatic execution for each one.Step 1: Create an Event Hook
Under Settings -> External System Integration -> Events, create one or both of the following Event Hooks:- TicketCreated — is triggered after receiving a new ticket and the completion of AI processing. Use when multiple AI agents on the initial email should be automatically executed.
- TicketResponse — is triggered when a response to an existing ticket has been received from the customer and AI processing has been completed. Use when AI agents should also be automatically executed in the case of sequential responses.
ready status and executes each one individually:
The
executeAgentId parameter is the numerical ID of the AI agent that should be executed. It is set per call for each AI agent.The allowMultipleIntents=true parameter allows automatic execution even when multiple AI agents have been recognized on the ticket. Without this parameter, execution is rejected for security reasons when multiple agents have been identified.The allowWithReplies=true parameter allows automatic execution even when the ticket already contains incoming customer responses. Without this parameter, execution is rejected as soon as a customer response exists on the ticket. This parameter is only relevant for the TicketResponse event.For clarity, error handling is deliberately omitted in this code example.
Step 2: Automatic Processing by Enneo
After each call to the Autoexecute endpoint, Enneo automatically performs the following steps:- The customer is sent the reply created by the AI agent.
- The ticket is closed.
- The ticket is marked as having been processed fully automatically (L5).
Notes
- The TicketCreated event is suitable for the initial email with multiple issues. The TicketResponse event is suitable for sequential responses. Both events can be configured simultaneously with the same code.
- The
allowWithReplies=trueparameter is necessary because Enneo by default blocks automatic execution as soon as a customer response exists on the ticket. For the TicketCreated event, this parameter is ineffective as there are not yet any responses. - The
allowMultipleIntents=trueparameter is necessary because without it, execution is rejected for security reasons when multiple agents are identified. - The
executeAgentIdparameter ensures that only the desired AI agent is executed per call. - It is recommended to maintain a whitelist (
allowedAgentIds) of the AI agents that are allowed for automatic execution in the code.