The final tasks are similar to regular non-final tasks and can be declared as PipelineTask. The only caveat here is final tasks do not allow two fields RunAfter and Conditions compared to non-final tasks.There are two different options to address that.
Declare final task as PipelineTask but add validation to not allow runAfter and conditions.