Code Tool inside AI Agent prioritizes Mapping input over From AI

Hi team,

I’ve encountered unexpected behavior when using a Code Tool inside an AI Agent. I isolated the functionality in a separate test flow to rule out any issues in my code, and after several tests, I confirmed that the problem is not in the code itself.

Observed behavior:

The Code Tool seems to accept two types of inputs:

  1. Mapping
  2. From AI (in my case, a valid JSON input)

My intention is for the Code Tool to process only the From AI input. However, it appears that the tool always defaults to reading the input from Mapping, completely ignoring the From AI input—even when the JSON is correctly structured.

I’ve tried explicitly setting the input type in the Code Tool configuration, but it still behaves the same. It keeps prioritizing the Mapping input no matter what I configure.

Result:

Although the From AI input is valid and properly formatted, the Code Tool doesn’t use it and instead processes the data from Mapping, which leads to unexpected results and breaks the intended logic.

Question:

Is there a way to explicitly force the Code Tool to ignore Mapping and process only the From AI input? Or is there any workaround to handle this case?

Thanks in advance!

Ignacio

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.