Extra fields returned from TN

Apologies if this has been discussed previously, I didn’t see anything immediately similar in the recent threads. I’m trying to return results of a service via TN. So I’ve set up a doctype/processing rule to synchronously execute my service, and the service drops everything from the pipeline except the desired result before returning. But TN seems insistent on returning extra metadata, such as flags, rule, etc. Does anyone know how to get back JUST my desired result via TN? Do I have to create an output template or DSP, perform some other filtering action, configure something differently? Any help would be appreciated.

> But TN seems insistent on returning extra metadata, such as
> flags, rule, etc.

Tons of junk may exist in a service at runtime. Undropped variables may be present from earlier processing rule executions. WM TN isn’t very disciplined itself either - it passes extra variables to the service called by the processing rule (even though the service signature only contains the 3 records described in “wm.tn.rec:ProcessingService”.)

The solution: call pub.flow:clearPipeline at the beginning and maybe at the end of your service. You have to set the ‘preserve’ array to the names of the variables you want to ‘preserve’ from being wiped from the pipeline.

Excellent, Sonam! That works beautifully. Thanks a million.

Dolt! I spoke too soon. This does work beautifully when you’re looking at the response in Developer. Unfortunately, TN still adds its extra goodies back when it sends the response. So again, thoughts appreciated.