Workflows Improvements: Correct string length and support for objects and arrays in inline variables

This is great, thank you @colin_mckibben !

Trying to get this to work, as I think this might be the solution to a functionality gap workflows has, where we first want to filter an array using JSONpath and then filter by index, as mentioned here:

As test, I have created a workflow, with external trigger, where the only action is to send an email. The email should send the name of the first item whose cost is 10 in the subject. As input to this, I use the example JSON file mentioned here:

So I tried the subject like this:
TEST {{$.trigger.items[?(@.cost == 10)].JSON()[0].name}}
The idea would be to:

  1. Have the original JSON visible in $.trigger
  2. Use the JSONpath .items[?(@.cost == 10)] to filter on items whose cost is 10.
  3. Add .JSON() to your JSONpath to force it to serialize to JSON as you mentioned.
  4. Use the JSONpath [0].name to get the name of the first item.

I expected this result:
TEST apple
However, the results show this:
TEST [map["color":"red" "cost":%!q(float64=10) "name":....., where all items of cost 10 are visible here. Shouldn’t the .JSON() command force this to serialize to JSON?