Capture complete msg to a global.property

#1

I feel this is dead simpe but my minds gone blank

I want to capture a complete msg object to re-use it for debugging purposes in another flow

So I thought - lets send it to global.whole

And then I thought - em - how do I do that

And then I thought - is this even the right way to do this!

help please :slight_smile:

0 Likes

#2

I too have been stymied by the TypedInput fields NOT allowing access to "the complete msg object", like the debug node option... in your case, it would be nice to be able to use a change node to set a global var to be the incoming msg object, or define the whole msg object in an inject node.

In the meantime, I don't see why you cannot do this in a function node:

global.set("whole", msg);
return msg;

... but tbh I have not tried it -- and i'm not sure whether reusing it later with its internal fields intact (e.g. _msgid, req, res) is even a good idea. But hey, I can only load the bullets... you'll have to shoot your own foot. ;*)

2 Likes