ExecuteScript - flowFile with new attributes not sent to next processor
I have a GenerateFlowFile processor that sends a flowFile to the ExecuteScript processor. In the ExecuteScript processor, I added a new attribute and value to the incoming flowFIle. But this updated flowFIle is not output to the next processor
Incoming FlowFile content from GenerateFlowFile
{'name':'myName'}
ExecuteScript script body
var flowFile = session.get();
if (flowFile != null) {
try {
flowFile = session.putAttribute(flowFile, 'gender', 'male');
session.transfer(flowFile, REL_SUCCESS);
} catch (e) {
session.transfer(flowFile, REL_FAILURE);
}
}
Output to next processor
{'name':'myName'}
Am I missing something??

