Create a Flow with only a screen element and no fields. Activate the Flow. URL: "/flow/<Flow API Name>?retURL= {! Case.Id }" Add the "Test Flow" button the the Case page layout in 'Mobile and Lightning Actions' section and save it.
2 The easiest way would be to embed the Flow in a visualforce page and have your button call your page. When you embed your flow there's a completion attribute you can assign to return the user when the flow is completed.
Add the "Test Flow" button the the Case page layout in 'Mobile and Lightning Actions' section and save it. Open a Case Detail Page. Do Finish on the Flow.
Confusingly if you launch a screen flow using buttons or Lightning pages, the flow will re-run and re-run until your users close the windows. Without redirection, your uses might execute the flows many more times than intended. Like in example, the user couldn’t see the flow has finished and cloned many cases without knowing.
retURL is a variable that you can add to the end of your flow URL when creating a button. You can use a static value which links to a specific page (ex. retURL = 5005I00000FkTTPQA3), or a dynamic value so it links to different pages based on where you launch the flow (ex. retURL = {!Case.Id}).
Redirection is a nice-to-have for autolaunched flows, but it can actually prevent errors for screen flows ! Confusingly if you launch a screen flow using buttons or Lightning pages, the flow will re-run and re-run until your users close the windows. Without redirection, your uses might execute the flows many more times than intended. Like in example, the user couldn’t see the flow has finished and cloned many cases without knowing.