Solved my own problem.
The way to do it is to add another input to your plugin that accepts managed folders ("acceptsManagedFolder": true) https://doc.dataiku.com/dss/latest/plugins/reference/recipes.html
Then read this input in your plugin and use it to get the path for the managed folders
"inputRoles" : [
{
...
},
{
"name": "genesets_input",
"label": "Managed folder of genesets",
"description": "The list of genesets to use in this analysis",
"arity": "UNARY",
"required": true,
"acceptsDataset": false,
"acceptsManagedFolder": true
}
],
and then in your R recipe code
genesets_input = dkuCustomRecipeInputNamesForRole("genesets_input")
path <- dkuManagedFolderPath(genesets_input[1])
Then share the managed folder with the project that needs it to run the plugin. As a bonus you see the managed folder being included in your flow graph.