Hi Martin,
To close explicitly / on-demand an activity, you can use the ActivityClose action from System.

It will trigger the OnClose event of the current activity of your process. You just need the current ActivityId which you already have, according to your comment.
Using this, you don't need to know which human activity you will be closing, it will close the one according to your input.
Regards,
João