Redirect Flow Finish Location to New Record Detail

One of the most common requests for Salesforce Flows is to push the user to the detail page of the new record being created inside flow.
This is quite easy to achieve by wrapping your flow in a Visualforce page and passing the Id of the new record into the VF Controller.

Lets first embed the flow inside a VF Page:

The interview attribute is used to link to the flow instance in the controller class.

Now lets look at the controller class:

So Assume that you have set a output variable in flow that is called newFlowRecordId and its value is the record id of the new record.
So simply put the VF Page will set the finish location for the linked flow to that set in the controller class. The value we have set in the controller is just the detail page of the new record.
It could of cause be any value you send back from flow, so you could pass a string for different situations your flow might end up in and then set the location accordingly.