File tree Expand file tree Collapse file tree
plugins/flowstudio-power-automate/skills/flowstudio-power-automate-build Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,14 +73,15 @@ ENV = "<environment-id>" # e.g. Default-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
7373Always look before you build to avoid duplicates:
7474
7575``` python
76- results = mcp(" list_store_flows" ,
77- environmentName = ENV , searchTerm = " My New Flow" )
76+ results = mcp(" list_live_flows" , environmentName = ENV )
7877
79- # list_store_flows returns a direct array (no wrapper object)
80- if len (results) > 0 :
78+ # list_live_flows returns { "flows": [...] }
79+ matches = [f for f in results[" flows" ]
80+ if " My New Flow" .lower() in f[" displayName" ].lower()]
81+
82+ if len (matches) > 0 :
8183 # Flow exists — modify rather than create
82- # id format is "<environmentId>.<flowId>" — split to get the flow UUID
83- FLOW_ID = results[0 ][" id" ].split(" ." , 1 )[1 ]
84+ FLOW_ID = matches[0 ][" id" ] # plain UUID from list_live_flows
8485 print (f " Existing flow: { FLOW_ID } " )
8586 defn = mcp(" get_live_flow" , environmentName = ENV , flowName = FLOW_ID )
8687else :
You can’t perform that action at this time.
0 commit comments