Combine input and output of node using JSON Path

The idea is:

Combine the input and output of a Node directly in the node. The idea would be to specify an output transformation using the node’s default output and the input.

My use case:

This is a feature in AWS Step Functions that I miss. I tend to build state as the workflow executes. I know we can access previous node’s data but this doesn’t always work very well. I tend to use Code nodes to apply output from things like HTTP nodes by referencing the previous node. Being able to specify an output transformation something like:
{ …$input, result: $output }
Would save me a lot of time. This is simplistic but providing a templating language could allow for manipulating the state more easily without relying on looking up previous nodes. I have run into problems when splitting arrays and that sort of thing.
But maybe I am just not doing something properly in n8n. But this is how I think about it when building workflows.

I think it would be beneficial to add this because:

I know for me it would save a lot of time and make my workflows easier to look at. Even just being able to specify a field name in the input where the output should go and then passing the entire thing out would help me tremendously.

Any resources to support this?

This is how it works in Step Functions: Specifying state output using ResultPath in Step Functions - AWS Step Functions

Are you willing to work on this?

I may be willing to help with this.