Can you merge JSON objects in the Flow "Transform Payload" operation

I essentially want to append a new field onto the JSON that I get from the trigger. If I was to just write it as a script I could just do

return {
    ...$trigger.payload,
    new_field: "value"
}

Is there a way to do this with the “Transform Payload” operation?

You should use something like this..

{
    "first": "{{ flow_output_A }}",
    "second": "{{ flow_output_B }}"
}