What is the 'tlv_payload' in lnd route? When creating a custom route, if you use the queryroutes from lnd it sometimes  with tlv_payload set to either True or False. How does the node figure whether to set this flag? 

I cant seem to find it in the source code. Clearly when using RPC calls such as 'getnodeinfo' the feature bit set from the node does not come through. So is this possible that the feature set per node is not exposed via RPC?
The tlv_payload is a modification to the way onion packets are created between the 1.0 version and the 1.1 version (current working version) of the BOLT specs. The (optional) feature is named var_onion_optin in BOLT#9.

In V1.0 of the spec, there was a fixed structure for sending onion payloads to hops along a route, which contained a short_channel_id, a cltv_expiry and an amount_to_forward. In the latest version, implementations can add custom data to be forwarded in addition to the previously required ones. These contain a type and length encoded as a compact size integer, and the value of length bytes is serialized afterwards. Hence Type-Length-Value, or TLV.

Nodes which support the newer format advertise the var_onion_optin feature when they broadcast a node_announcement message, by setting bit #9 in the features field of this message.

In the lnd codebase, the feature folder contains the logic for feature bit vectors. It appears from manager.go that LND now treats the tlv_payload as enabled by default unless it is disabled as part of the config. Older versions of LND will obviously not support the feature and will use the legacy hop_data payload format.