Automatically import SubModule

Hi all, I’m trying to import a subflow into a project. I’ve been using an HTTP POST request to /flow, which works fine for flows but not for subflows. I’ve tried reorganizing the JSON data, but I still haven’t had any success. Is there a way to import a subflow if it doesn’t exist or update it if it already exist? Target is to make automatic update, Thank you a lot

Hi @PetrVasata

Subflows live on the global flow - if you do a GET to /flow/global you'll find all of the current subflow definitions.

To add a subflow you will need to first get /flow/global, add the subflow to that and post it back.

It's a little awkward and I do think it would be better to have a cleaner api for adding/removing subflows, but this is what we have today.

Thank you a lot for help. Works fantastic