No need to get the id in the Modeler. In your Xpath, you can use the attribute name id. So if you have the object you are trying to retrieve in a microflow as $ObjectName, your Xpath can look like this:
id = $ObjectName
Is there a requirement you have where that won't work?
If you need to use the actual guid then you'll have to do it via java.
I think this question will help: