Pragmatism proposes that scientific method exists because it works -as far as I remember. If it is so, is there any need of epistemology?
I could have the wrong take on this, but to me, this question should have a similar maxim to 'Correlation does not equal Causation'.
A pragmatism in science still deals with the provable, instead of the certain. There was a time when science supported the application of leeches (and bloodletting) in medicine 'because it worked'. That these medical approaches were applied and patients got better just reinforced the believe.
In my view, epistemology looks at the world through a more theoretical lens than scientific pragmatism. In that way, epistemology is more like meta-science (not in the conventional semantics of meta-physics, but in the true intent of meaning behind the term - the science of science, or scientific strategy).
Another way of putting this; science is an inherently tactical method; you observe, you hypothesise, and you prove or disprove through experimentation. This method is deliberately non-strategic in nature because to put a strategic direction behind it would put bias on certain beliefs or approaches. As we learn more about the body, the views mentioned above (proven in a wealth of experimentation and practice) must be called into doubt when related fields clash with it.
Epistemology on the other hand looks at the approach being applied from that strategic standpoint that allows us to change major directions when we're headed down a scientific dead-end, so to speak. This is because (in my humble view) epistemology is focused more on truth which can be applied practically, where as scientific pragmatism implies truth from practice.
Both climb the same mountain, but from opposite sides.
"Pragmatism is a philosophical tradition that – very broadly – understands knowing the world as inseparable from agency within it," according to Stanford Encyclopedia of Philosophy.
The above, however, does not imply that "scientific method exists because it works".
Rather, we must assume that scientific method works. That assumption itself is fundamentally irrational, Søren Kierkegaard's leap of faith. However, the act of making that assumption, making that leap of faith, is our only rational choice.
Indeed, we must make it in order to have any agency (and, thus, any freedom) whatsoever <== I can explain the last point as well, if you think it would still be on topic.