cmptr
cmptr3w ago

See Windmill script dependents via API

Using the Windmill API is it possible to see all of the flows where a specified script is being used?
16 Replies
rubenf
rubenf3w ago
Yes, @Diego
cmptr
cmptrOP3w ago
thanks Ruben, I didn't see it immediately in the api docs
Diego
Diego3w ago
Roles and permissions | Windmill
Windmill provides a roles and permissions system that allows you to control access and manage permissions within your instance and workspaces. Different roles have different levels of access to scripts, flows, apps, and other entities in Windmill.
Diego
Diego3w ago
You can hover the little info icon
No description
rubenf
rubenf3w ago
@Diego he is asking about the API methods https://app.windmill.dev/openapi.html#/ so in
Diego
Diego3w ago
oh mb It's /w/{workspace}/scripts/list_paths_from_workspace_runnable/{path} but for some reason it's not in the openapi web docs
cmptr
cmptrOP4d ago
ahh this does not appear to be working when I attempt to query this endpoint using a script that I know is in use in the workspace
Diego
Diego4d ago
what do you mean by it not working does it raise an error? or does it return no usage even though it's incorrect
Robby
Robby4d ago
Speaking for @cmptr, it is currently returning an empty array.
rubenf
rubenf4d ago
would you have more details about how the sripts are currently related?
Robby
Robby4d ago
Sure. Essentially we are attempting to find all uses of a specific script. Let's say we have Script A that contains some common logic. That script is used in both Flow 1 and Flow 2. What we are attempting to accomplish is when a change is made to Script A, we can tell that that script may effect both Flow 1 and Flow 2. Hopefully this makes sense!
rubenf
rubenf4d ago
It makes sense and it should work. Can you reproduce on a new flow as well?
Diego
Diego4d ago
Tested and it still works on my end (This uses the same API endpoint). Maybe your flow was deployed before the dependency tracking feature was released?
No description
Robby
Robby4d ago
We may just be misunderstanding the endpoint. Here are a few screenshots:
No description
No description
Diego
Diego4d ago
really weird. Maybe check the network tab of the devtools to check what URL the UI feature calls successfully and how it differs? i’ll investigate tommorow if you don’t find out
Robby
Robby4d ago
Great Suggestion! I found the issue: {{baseUrl}}/w/:workspace/flows/list_paths_from_workspace_runnable/script/:path is the path for the api.

Did you find this page helpful?