Recursive GitHub repo structure extract leading to multiple runs

I’ve been struggeling all day how to solve this.
Altough the problem might not be that grave it is bothering me a lot:

I am trying to extract my whole project structure in github, but the github nodes only return one level of the structure.
Because of this I’ve created a loop and filter which makes the github node retrieve next level of any folder that is found.

This is fine, but at the end I get 5 runs / 5 result sets which leads to my file writes being done multiple times (with more data each time).
I’ve tried the loop and if node for checking remaining items, I really wish that the code node would’ve access to all run outputs so I could just fix this in code.

Or a node that would allow me to call GitHub using the recursive option in the URL.

I am running the web version of n8n and I’ve tried searching all day finding a bunch of solutions that hasn’t worked for me. Sorry if I am asking an already answered, but been pulling my hair too long with this.

hello @Rakie

Better to get paths via recursive workflow (just like a recusrive function).
Your main WF would be

And a sub WF, which executes itself

4 Likes

Beautiful solution.
Works perfectly. :heart_eyes:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.