30
Views
8
Comments
Solved
Agentic AI Call Condition document ambiguity

Hello everyone, I was reading the ODC Agentic AI documentation and had trouble understanding something here:

Link to document: https://success.outsystems.com/documentation/outsystems_developer_cloud/building_apps/build_ai_powered_apps/agentic_apps_in_odc/ai_agent_actions/#loops-and-internal-variables

Quote:

"The agent may continue to execute actions as long as your expression evaluates to False." -> do-while-False pattern

But in the example: 

  • To stop the process before it consumes 3000 tokens: TokenUsage < 8000 -> Inconsistent thresholds
  • To limit the agent to a maximum of fifty reasoning loops: LoopCount < 50 -> since the LoopCount starts at 0, this condition follows a do-while-True pattern
  • To stop the agent after it has made a total of thirty action calls (regardless of the number of loops): TotalCallsCount < 25 -> since the TotalCallsCount starts at 0, this condition also follows a do-while-True pattern
  • To apply multiple conditions simultaneously: TokenUsage < 8000 and TotalCallsCount < 25 -> also do-while-True pattern

Have I misunderstood something here?

2016-04-22 00-29-45
Nuno Reis
 
MVP
Solution

Hello.

It is a new course (5 days old), a lot of sections are being improved based on feedback.

Based on 4 reviewers that I know, that error is the only serious one and was reported before.
It stops when True so most conditions are wrong and yes, the 8000 should be 3000.

It should be fixed soon.

If you spot anything else, feel free to add here as the fix will be communicated here and the team is reading the post.

UserImage.jpg
Trac Duc Anh Luong

@Nuno Reis 

Got it, appreciate the transparency. Looking forward to the update!

2023-10-16 05-50-48
Shingo Lam

Hi @Trac Duc Anh Luong

The document is a bit obscure, but you can find the other information specifying if the expression is True, the agent stops. So it is wrong example which is on the opposite way, I have proposed the changes to the document. Will keep you posted.

UserImage.jpg
Trac Duc Anh Luong

Thanks @Shingo Lam, 

I prefer your proposed changes to the current doc. Much clearer & easier to comprehend.

2023-10-16 05-50-48
Shingo Lam

You are welcome. Nice catch on the document. Keep walking!

2025-12-22 13-50-43
Sherif El-Habibi
Champion

Hello,

What you should know about the condition is that it is designed to act as a red light for the agent, signaling when it should stop. For example, you’ve created an agent that depends on a specific number, which it uses to distribute among users, for example employees receiving salaries.

This is where the condition plays its role. In the SystemMessage, you define the agent as a distributor of a number. Then, in the Call Agent action, you use an action that outputs the number itself.

If you leave the condition untouched, the agent will continue distributing the number indefinitely until the list of users ends. However, with the condition in place, you instruct the agent to stop once the number reaches zero and of course keeps decrementing the number until it reaches zero, ensuring that the value is distributed evenly.

UserImage.jpg
Trac Duc Anh Luong

Hi @Sherif El-Habibi,

Thanks for your explanation & example. I understand that the "Call Condition" acts as a threshold that tells when an Agent should stop. However, the wording in the documentation is somewhat confusing to me.

"The agent may continue to execute actions as long as your expression evaluates to False."

-> I believe this is a do-while-False pattern, meaning the Agent will stop calling action(s) once the expression evaluates to True:

Expression: LoopCount >= 50

  • LoopCount = 0 -> 49: False, can continue calling actions
  • LoopCount = 50: True, stop calling actions

However, examples in the documentation are the opposite, following a do-while-True pattern:

Expression: LoopCount < 50 

  • LoopCount = 0 -> 49: True, can continue calling actions
  • LoopCount = 50: False, stop calling actions

What do you think the pattern should be here?

2025-12-22 13-50-43
Sherif El-Habibi
Champion

Based on the sentence “The agent may continue to execute actions as long as your expression evaluates to False,” the current documentation can be little confusing. 

While the pattern could technically work either way, to avoid misunderstanding, the sentence should be changed to evaluate to True, or the examples updated to match the False pattern. 

Nuno has also approved that this will be fixed.

2016-04-22 00-29-45
Nuno Reis
 
MVP
Solution

Hello.

It is a new course (5 days old), a lot of sections are being improved based on feedback.

Based on 4 reviewers that I know, that error is the only serious one and was reported before.
It stops when True so most conditions are wrong and yes, the 8000 should be 3000.

It should be fixed soon.

If you spot anything else, feel free to add here as the fix will be communicated here and the team is reading the post.

UserImage.jpg
Trac Duc Anh Luong

@Nuno Reis 

Got it, appreciate the transparency. Looking forward to the update!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.