If I understand correctly You want to get filename on which workflow has been initiated. Your code snippet looks OK but make sure title property is defined for given nodeRef else it will give undefined.
You can also test by hitting direct metadata URL and check if title is available in response - alfresco/service/api/metadata?nodeRef=workspace://SpacesStore/bc40148c-0e85-484d-a6f3-c97329183d3f&shortQNames=true