JSON PATH error using API

Hello all!

I have created a KNIME flow to connect to a AI API and translate a specific column in English. I loop trough each line of the column, in the string manipulation I have added the LLM instructions, Post request contains the API key, Json path creates the translation column. everything works very well and I get the result that I want. The problem is that I have transferred the flow to another colleague using the same data and he gets this error on the Json Path: “Execute failed: Input table’s structure differ from reference (first iteration) Table: Column 98 [body(JSON)]vs[body(Binary object)]“. it fail at the first iteration, column 98 is the body column, you can see the content in the picture. do you have any idea why we have this problem?

thank you for your help

@CYLE Based on the error message, the first iteration returned a Binary Object, while the current instance returned JSON.

Currently, you cannot force REST nodes to output a specific column type (we have a ticket for this: AP-21611).

Possible workarounds

  1. Loop End Settings: Check the box “Allow changing table specifications”. This allows the loop to continue even if the column type changes from Binary to JSON between iterations.
  2. Filter Rows: Alternatively, use a Rule-based Row Splitter (e.g., Status = 200 or content type like json) before the JSON Path node. This ensures only valid JSON rows are processed, avoiding the mismatch entirely.
1 Like

Hello @k10shetty1 thank you for your reply! before trying your approach, I noticed in further iterations is that the error sometimes disappear. another time I got the same error because the body column came out of the POST REQUEST as type: BLOB. is your proposal going to fix this random behavior?

thank you!

you can always convert binary to string, and then to json

@CYLE Could you please share the Status and Content type values for the specific rows where the Body column is appearing as a Binary Object (BLOB)?

The POST Request node usually outputs a BLOB when the API returns a response type it doesn’t recognize as standard JSON ( an HTML error page, a text file, etc.).

Knowing the Content-type will help determine if we can convert that BLOB to a String (using Binary Objects to Strings) or if the API is returning a different file type.