Single OSM way that spans accross multiple branch roads

For example, this high way in jordan has multiple entrance and exits along the way, yet the OSM network does not have different IDs between each individual exits and entrances (Singapore has good examples to compare an opposite case).

I implemented custom tags that help me determine travel mode access. In Jordan’s case, this can cause an issue where a Way could say that it’s walkable, but in reality it’s only partially walkable.

How does Graphhopper handle such case on the instruction level?

GraphHopper splits OSM ways into several ‘edges’ at every junction (all nodes where ways intersect) and assigns a unique ID to each edge. The OSM way ID isn’t really used for much beyond that for the reasons you mentioned.

so if I have the a custom tag <allow_foot=yes> on a partially walkable OSM way, is there a way for me to specify the graphhopper link that I want the tag to apply to and not the whole way?

GraphHopper uses the same OSM way tags for all links it splits a way into. If you knew the link ID you want to change you could of course change it’s attributes afterwards. I’m not sure I fully understood your question. Do you have an example? If you think an OSM way is only partially accessible for pedestrians that might justify splitting it into several ways, because the tags aren’t appropriate for all parts of the way.