AI agent subprocess - tool calling issue

techStuffProcess.bpmn (13.3 KB)
techStuffResultForm.form (641 Bytes)

I am following @Niall video (https://www.youtube.com/watch?v=E0BaMLL5Uf4&t=5s),
LLM - Ollama local
Runtime - C8 Run on local
Version - 8.9
Hardcoded Prompt on AI Agent sub process - “List down all tech stuff”

Observation

Sometimes Rest connector gets call and toolCallResult populates with json response of api, but user task gets skip.
Sometimes, REST connector skips and user task gets executed, but since no toolCallResult from REST connector so data in user task remains used variables

Why this is happenig, Initially I though if description matters for this calling, but now almost copied as per @Niall video, but still either of above observation executes.


Inconsistent tool-calling with local Ollama models in an AI Agent subprocess is often related to connector runtime version, missing/incorrect toolCallResult naming, or LLM prompt/model tool-calling capability. I found the following relevant resources:

Does this help? If not, can anyone from the community jump in? :waving_hand:


:light_bulb: Hints: Use the Ask AI feature in Camunda’s documentation to chat with AI and get fast help. Report bugs and features in Camuda’s GitHub issue tracker. Trust the process. :robot:

@Webcyberrob @cpbpm @Niall can you pl. suggest on this?

Hi

It looks like your intent is the rest call fetches some data, the user task displays the data. If this is the case, you are better off imho to join these two tasks as a mini process. Hence there is then only one tool to call…

So my guiding priciple is, if sequence is deterministic, use an explicit flow.

Otherwise you will either have to turn down temperature etc, or spend a lot of time crafting prompts to synthesize deterministic sequence. .

@Webcyberrob comment is the right solution is your user task is actually the dispaly of the output data from the REST CONNECTOR. However, from experience, AI agentic in Camunda strongly relies on the content of user/system prompts. It’s fairly hard to “formally” control what the AI agent has to do/does to conform with the business requirements. Besides, putting ‘temperature’ to zero is a good choice to have better control. As a summary, this is really a matter of prompt engineering and, as BPMN analyst, it’s a huge mind switch!

is your user task → if your user task

Ahha… I really didn’t know if prompt matters till this extent.

Nevertheless, in @Niall tutorial video, prompts was bit ordinary like human commands and those AI agent tasks were not linked then I am guessing this is because underlying LLM that is being used have capacity to do reasoning?

His demo was having Amazon Bedrock, and I am using local Ollama LLM.

I guess Ollama is OK. I personnally use Ollama with Qwen3 in dev. env. because other “agentic” LLMs were disappointing for me, but perhaps, my use case is too specific. To develop my viewpoint: test and tuning of my genuinely industrial case was/is a nightmare, spending most time on prompts to get something “consistent” (not to say “meaningful”) with respect to the business expectations. To be sincere: a bit disappointed by agentic at this point, but maybe I don’t have enough expertise?

Current LLMs do not have a capacity for reasoning.
They are next token predictors, much like the autocomplete on your cellphone’s keyboard.