rich-megabyte-50989
09/11/2025, 4:39 AMevent.state.context.currentNode variable but I can't seem to match it with my node name. The code I used is as follows:
if (event.state.context.currentNode === 'node:<Node Name>') {
// Code to execute
}
Is there a way to limit the hook to only trigger in certain nodes?
Furthermore, I've also tried to override the response sent by the node with the new response returned by the API. However, I can't seem to find the variable I need to override to implement this. I've tried overriding the execution and event.payload variables.
Is there a way to override an autonomous node's response inside a hook?
Thank you in advance!lively-petabyte-5010
09/11/2025, 2:31 PMrich-megabyte-50989
09/11/2025, 5:56 PMcurrentNode check, I initially got confused because the value shown in the log was always in the node:<Node Name> format. Instead like you said, we need to match it against the node's id (something like nd-<Node ID>).
For the output override, I got it working by overriding both outgoingEvent.payload and outgoingEvent.preview with the API's return value.
Thanks again for your help