How to stop a running Dify workflow

I have a workflow configured in Dify that is called by my frontend, but I want to add a stop mechanism to allow the running Dify workflow to stop its current task upon receiving a message. How should I implement this?