# How to call Pega GenAI Connect in case workflow

**URL:** <https://forums.pega.com/t/how-to-call-pega-genai-connect-in-case-workflow/11066>\
**Category:** Knowledge Share\
**Tags:** citizen-developer, app-studio, ui-solutions-developer, solutions-consulting-manager, user-experience, solutions-consultant, solutions-engineer, generative-ai, system-architect, lead-system-architect, case-management, senior-system-architect, pega-platform\
**Created:** [March 10, 2026, 7:52pm UTC](https://forums.pega.com/t/how-to-call-pega-genai-connect-in-case-workflow/11066 "2026-03-10T19:52:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Will\_Cho](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/will_cho/32/23260_2.png) [@Will\_Cho](https://forums.pega.com/u/Will_Cho)\
**Post date:** [March 10, 2026, 7:52pm UTC](https://forums.pega.com/t/how-to-call-pega-genai-connect-in-case-workflow/11066/1 "2026-03-10T19:52:28Z")

</div>

This knowledge sharing article demonstrates how to call **Pega GenAI Connect** rule from a case workflow and use it as an AI agent to quickly research needed information and summarize the findings in a structured format for user review.

Pega Infinity version used: **25.1.2**

= = =

**Runtime results**

Let’s first look at the runtime results before getting into the configurations.

We have a FSC- case type (Find Sports Champion) that uses a GenAI model to quickly research the champion details in a given sports (entered by user).

**Step 1** - Launch the Find Sports Champion case type.

Enter the Which sports? and From year fields.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/a/5/a5452062741a88c1845ed2fc1cadcb65e02e5a05.jpeg)

Click Submit.

**Step 2** – Calling a GenAI Connect rule and waiting for the response.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/3/d/3d7af8c324723ef0f847cb16a2cce9ef59643330.jpeg)

**Step 3** – Display the GenAI response in a structured list

The following table shows a list of FIFA World Cup Soccer champions since year 2000 (prompted by user).

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/5/8/582dbdc460b7b3a251c53e21991c7ba296e583d3.jpeg)

Note: GenAI Connect rule was smart enough to get the additional details such as venue, head coach, Most Valuable Player (MVP), and the team strengths and map to the table even though those information were not explicitly requested in the prompt. The following configurations will show how this happened in the GenAI Connect rule.

Prompted for another example - NFL champions since 2020.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/6/a/6af7fa96f4d600f6d059c47343160a9cdc57a3bc.png)

**Configurations**

**Step 1** – Create a GenAI Connect rule.

We’re using a structured list for Response.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/d/a/da26a6ab0e6851c793637333a2c528dddea22f21.png)

Here is the **Champion** data object used to define the **.ChampionList** field referenced in the GenAI Connect rule \> Response.

Note: One key observation is that the GenAI Connect rule was smart enough to retrieve additional information about each champion based on the Champion fields mapped in the Response section (even though those details were not included in the prompt).

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/d/6/d640b64baf62593fd524479abc3acfe250c503e9.jpeg)

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/d/0/d0eed168a047d79c7441b26a988bbf98a5fadd11.png)

The user prompt is configured in a Field Value rule.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/c/4/c4c2ad61fd0b9228a4293e84270ec0e7fcf3dd1a.png)

There are two parameters: .WhichSports and .FromYear (entered by user)

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/3/8/38b1c8a88b84ffbfddadb779df87fec9627b0562.png)

```markdown
Research and provide a list of all-time sports champions in {.WhichSports} since year {.FromYear}. Save this prompt. 

```

Under the Advanced tab, we selected **Gemini-Pro** as our GenAI model.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/5/8/586a604a0355637e3f420affb7db0278935e43d8.png)

There are additional GenAI models available if needed.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/b/8/b8bc24c53c6254e022e09a3d9cb8029454fad1db.png)

**Step 2** – Create a view to capture the prompt details from user.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/4/b/4b8fc0b1f48464a468155fd66ffe19cfa3fa3fc2.png)

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/3/8/381d6b1d000fbfa3755a23830ac247f9c1fca352.png)

**Step 3** – Reference the GenAI Connect rule in the case workflow.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/b/0/b0ff08b7280a68e968f7e54c0385d6f60cd436d8.png)

**Step 4** – Save the GenAI prompt text.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/7/9/79f400f3d853d8345c3ca63e9369e3f8a148feea.png)

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/1/c/1c9a617ff9fdf3f4c00f8650f8fba2522177ff31.png)

In this example, we’re prompting GenAI to save the prompt text in the **.ChampionList()** response field.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/8/3/838c2565a68b96ee943aed25dd1511d00b3f485e.png)

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/0/a/0a172a2413ad7ed165c4f42a722630b6121c9a17.png)

**Step 5** – Configure a view to display the GenAI response.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/f/e/fe2c30cf7cda174dd09c37e50d17da89544ae728.png)

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/0/d/0d628a18ab425523135919455e4fd8f17bd6b4a5.png)

Display the ChampionList in a **Table** layout.

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/1/c/1c9c053d7abec2f7ca425c0415b402d4d822bcff.png)

Runtime view:

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/c/1/c13e920bb190be31d76e6758de1a6093b76daa2b.png)

**Additional notes**

- This was my first-time implementing GenAI Connect rule in Pega Infinity, and the experience was seamless.
- Had to enable GenAI feature in my Pega Lab instance.

**Other references (Pega GenAI)**

- [How to use Pega GenAI Connect to process incoming email and attached document](https://forums.pega.com/t/how-to-use-pega-genai-connect-to-process-incoming-email-and-attached-document/11988)
- [How to use Pega GenAI Connect for intelligent document processing](https://forums.pega.com/t/how-to-summarize-tabular-data-from-pdf-document-using-pega-genai-connect/11697)
- [How to use Pega AI Agent for intelligent case working](https://forums.pega.com/t/how-to-work-with-pega-genai-agent-on-a-case/11201)

= = =

Please feel free to leave any comment or question.

---

<div class="post-metadata">

**Author:** ![Tim\_Straatsma](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/tim_straatsma/32/23258_2.png) [@Tim\_Straatsma](https://forums.pega.com/u/Tim_Straatsma)\
**Post date:** [March 11, 2026, 4:38pm UTC](https://forums.pega.com/t/how-to-call-pega-genai-connect-in-case-workflow/11066/2 "2026-03-11T16:38:15Z")

</div>

Nice walkthrough @Will_Cho !

In your setup, you rely on the LLM to provide the facts on the sports teams. While this of course is possible as you demonstrated, I wanted to add that in most enterprise settings we would typically not want to rely on the ‘knowledge’ of the LLM itself, because they have been pre-trained, and so their knowledge has a cut-off point (For Gemini 2.5 Pro I believe this was January 2025)

So in a use case like this, we would typically either

- Provide the Connect GenAI prompt with current data from the case Data Model that needs to be used in the response
- Use a Knowledge Buddy to retrieve correct and current information from a content store that is in our enterprise domain
- Or, use an Agent with a Tool that allows it to query the internet or external sources (e.g. a tool that lets the Agent retrieve live data from Wikipedia)

---

<div class="post-metadata">

**Author:** ![carej1](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/carej1/32/22900_2.png) [@carej1](https://forums.pega.com/u/carej1)\
**Post date:** [March 11, 2026, 6:30pm UTC](https://forums.pega.com/t/how-to-call-pega-genai-connect-in-case-workflow/11066/3 "2026-03-11T18:30:33Z")

</div>

When using GenAI Connect to read documents (DocAI) the convention to populate a page list property is a little strange. It is very difficult to do in AppStudio. But if you are configuring the connect rule in DevStudio the convention is this:

- Select Structured Single
- Configure the Page List properties like this
  - .PageListName().propertyName

The LLM should find the properties in it’s processing results and popultate a PageListName page for each set of properties. It is possible that the same configuration will work in your case.

 ![Screenshot 2026-03-11 at 2.30.10 PM](https://pega1.discourse-cdn.com/pega/original/3X/3/1/314de988536545f3e2cd6d471ef3cd0830189330.png)

---

<div class="post-metadata">

**Author:** ![lakhank7](https://avatars.discourse-cdn.com/v4/letter/l/ecb155/32.png) [@lakhank7](https://forums.pega.com/u/lakhank7)\
**Post date:** [March 12, 2026, 6:13am UTC](https://forums.pega.com/t/how-to-call-pega-genai-connect-in-case-workflow/11066/4 "2026-03-12T06:13:10Z")

</div>

I agree with you @Tim_Straatsma somewhat but have a slightly different take on this.

I believe every knowledge repository used by an AI system needs to be updated regularly; otherwise, it may generate outdated or inaccurate responses. Organizational policies may not change frequently, but whenever they do, the knowledge base should be updated accordingly. Similarly, if an underlying API changes, the corresponding tool definitions or integration schemas should also be updated to ensure the AI interacts with the system correctly.

---

<div class="post-metadata">

**Author:** ![Will\_Cho](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/will_cho/32/23260_2.png) [@Will\_Cho](https://forums.pega.com/u/Will_Cho)\
**Post date:** [March 12, 2026, 2:30pm UTC](https://forums.pega.com/t/how-to-call-pega-genai-connect-in-case-workflow/11066/5 "2026-03-12T14:30:40Z")

</div>

Questions from my colleage:

**Is this prompt working for all the models listed in GenAI connector?**

I think No. Depending on the model, I receive error like

```auto
Gateway LLM Resource Not Found

```

**Will it consume tokens in each query?**

I think Yes. Depending on the usage, I receive error like below (since i’m using Pega Lab where there is a daily GenAI usage limit). On the other hand, clients will not experience this on real systems.

```auto
Gateway Authentication Error: DAILY_QUOTA_EXCEEDED

```

Please feel free for others to chime in.

---

<div class="post-metadata">

**Author:** ![Fernando\_Diaz](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/fernando_diaz/32/23696_2.png) [@Fernando\_Diaz](https://forums.pega.com/u/Fernando_Diaz)\
**Post date:** [March 12, 2026, 9:09pm UTC](https://forums.pega.com/t/how-to-call-pega-genai-connect-in-case-workflow/11066/6 "2026-03-12T21:09:10Z")

</div>

> [@Will\_Cho](#):
>
> Is this prompt working for all the models listed in GenAI connector?

Hi @Will_Cho, nice setup, well done!!!

I don’t think this is a prompt issue. If this is happening in a **Pega GenAI Connect** rule and only with some models, **“Gateway LLM Resource Not Found”** sounds more like the gateway can’t resolve that model/resource in that environment. I’d look at **model mapping, provisioning, region,gateway service config or temporary model integration** rather than the prompt itself.

---

<div class="post-metadata">

**Author:** ![anandchouti](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/anandchouti/32/23738_2.png) [@anandchouti](https://forums.pega.com/u/anandchouti)\
**Post date:** [March 16, 2026, 6:12pm UTC](https://forums.pega.com/t/how-to-call-pega-genai-connect-in-case-workflow/11066/7 "2026-03-16T18:12:37Z")

</div>

@Will_Cho Thanks for the details. This is very useful. If we were to debug the GenAI connect rule, are there better/alternatives apart from tracing the standalone rule and checking the request and response details from the Tracer? I dont see the request and response getting logged in PegaRules when I set the log level of RESTConnector to debug.

---

<div class="post-metadata">

**Author:** ![Will\_Cho](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/will_cho/32/23260_2.png) [@Will\_Cho](https://forums.pega.com/u/Will_Cho)\
**Post date:** [March 17, 2026, 2:16pm UTC](https://forums.pega.com/t/how-to-call-pega-genai-connect-in-case-workflow/11066/8 "2026-03-17T14:16:17Z")

</div>

@anandchouti hi Anand, hope you are doing well. I tried a couple of GenAI loggers but they didn’t print out the actual content of GenAI request/response. They only logged the GenAI activity steps with DEBUG.

I can see the Request/Response details in Tracer but not in the log. As a temporary work around, you could Log-Message (InfoForded) the page that contains the GenAI Request/Response.

In my example, i stored the GenAI request here:

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/d/2/d29d9f7c822d3c9dba156bd7a6d6ee6b6ab34055.png)

And the GenAI response here:

 ![image](https://pega1.discourse-cdn.com/pega/original/3X/c/2/c27fb103d366f60ce8005ff0ee4b208cc6a0dd75.png)

---

<div class="post-metadata">

**Author:** ![Will\_Cho](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/will_cho/32/23260_2.png) [@Will\_Cho](https://forums.pega.com/u/Will_Cho)\
**Post date:** [March 17, 2026, 2:18pm UTC](https://forums.pega.com/t/how-to-call-pega-genai-connect-in-case-workflow/11066/9 "2026-03-17T14:18:32Z")

</div>

@Tim_Straatsma is there any DEBUG logger that can print out the actual content of the GenAI prompt text and reponse to PegaRULES log? Please see @anandchouti’s question. I offered a workaround but that requires a development (and deployment). It will be nice if we have GenAI loggers that clients can control using Admin Studio without any code development/deployment.
