Enjoyed this article? See more similar articles in ![]()
![]()
Pega Cookbook - Gen AI Recipes ![]()
![]()
series.
Pega Agentic AI: Run AI in the Background with Queue Processors
In Pega, agentic AI processing can be offloaded to a Queue Processor so that large language model (LLM) execution does not run on the user’s requestor thread. This is an important design pattern when using AI-driven steps in case processing, because LLM responses can sometimes take longer to complete depending on the depth of reasoning required, the size of the prompt, model latency, and other runtime factors.
Demo: https://players.brightcove.net/1519050010001/default_default/index.html?videoId=6394291352112
If the agent runs synchronously on the user thread, the user must wait at the assignment until the AI response is returned. This can slow down the submission experience and create unnecessary delays in the flow. By using a Queue Processor, Pega invokes the agent behind the scenes in the background, allowing the user to move forward without being blocked by AI processing time.
Once the case reaches the relevant step, Pega queues the background task and continues the user journey without interruption. The Queue Processor then executes the Agentic AI asynchronously, retrieves the response, and updates the case when processing is complete. After the agent step finishes, the case is automatically routed to the next assignment so the user can continue with the AI-generated output already available for review or action.
Benefits of running the agent in the background in Pega
-
Improved user experience: Users are not forced to wait on an assignment while the AI completes its work.
-
Better responsiveness: The submission flow remains fast and interactive, even when LLM processing takes longer.
-
Support for deep reasoning: LLMs may require additional time for complex reasoning, larger context windows, or external processing steps. Running in the background avoids exposing that delay to the user.
-
Reduced impact on user requestors: The user thread is freed up, which helps prevent front-end slowdowns and improves overall application responsiveness.
-
Automatic case progression: Once the background AI task completes, Pega can move the assignment forward automatically to the next stage in the process.
-
More scalable design: Queue Processors provide a more robust and scalable way to handle variable AI response times across many cases.
This pattern is especially valuable in Pega applications where AI is used to assist with case decisions, recommendations, summaries, or next-best-action guidance. Since LLM execution time may vary, background processing helps ensure that users can continue their work without disruption while the system completes the AI task asynchronously.
Enjoyed this article? See more similar articles in ![]()
![]()
Pega Cookbook - Gen AI Recipes ![]()
![]()
series.
