I was reading the discution between @mscoutermarsh and @paul-sachs and got a little bit confused in the term “Job”. The docs says “A workflow is a configurable automated process made up of one or more jobs.” so I though that maybe i could use @paul-sachs 's script to delete the artificact produced by Job A in Job B. I did not succeed.
Improving @mscoutermarsh 's answer i could say that:
The runner doesn’t “record” the Artifacts until the workflow run completes. Once the workflow run is completed, then they are available in the API.
I also agree with @paul-sachs that the artifact could be availlable in the API by the end of the Job that creates/uploads it, in order to delete it by the end of the workflow run