Don't worry about that deprecated warning, we don't have any replacement for that feature, and it won't be removed until we have such a replacement. You can keep using a variable on a variable-length rel pattern.
That said, with a path variable (like your p), we can do what we need.
Also keep in mind that getting distinct node results (as in the apoc spanningTree() call) will not include any results where a different relationship is used to reach an already-visited node. You'll have to determine yourself what's more important for results, or if your results need to have their format changed.
MATCH (n: process {guid: "44b77af0-3b7e-4ce7-b74f-e967007cfdf8"})
CALL apoc.path.spanningTree(n, {maxLevel:3}) YIELD path WITH nodes(path) as nodes, relationships(path) as relationships
UNWIND nodes as nodesrow
UNWIND relationships as relationshipsrow
RETURN nodesrow as Node, labels(nodesrow) as Nodetype, relationshipsrow AS Relationship,type(relationshipsrow) AS RelationshipType
But is ther a way to Acess the NEXT element in the Row aswell? So i HAve access to the Left and the right Node of a relationship?
MATCH (n: process {guid: "44b77af0-3b7e-4ce7-b74f-e967007cfdf8"})
CALL apoc.path.spanningTree(n, {maxLevel:3}) YIELD path WITH nodes(path) as nodes, relationships(path) as relationships
UNWIND nodes as nodesrow
UNWIND relationships as relationshipsrow
RETURN nodesrow as LeftNode, labels(nodesrow) as LeftNodetype, relationshipsrow AS Relationship,type(relationshipsrow) AS RelationshipType, **nodesrow[1] as
RightNode , labels(nodesrow[1]) as RightNodetype**
I also do the following DISTINCT at the moment to get less data
Match (n: process {guid: "5faacb1f-bf87-45a6-92fd-0ae735f74eee"})-[r]-(m) CALL apoc.path.spanningTree(n, {labelFilter: "status", relationshipFilter: "start_status|next_status|current_status", maxLevel: "4"}) YIELD path WITH nodes(path) as nodes, relationships(path) as relationships UNWIND nodes as nodesrow UNWIND relationships as relationshipsrow RETURN Distinct(nodesrow+labels(nodesrow)+relationshipsrow+type(relationshipsrow));