How to get the current Activity name

i want to assign the current activity display name to my new variable.
image
Just like that i want to assign the “X” Activity to my new variable. THE X can be dynamic and that why i should get that by code.

Check this forum post: Get Process Name - #6 by jeevith

Edit: Instead of process name, use WorkflowName in your case.

thanks but it will output the name of my workflow name: it output “main”. i want “X” Activity name just in my picture

Not sure if that’s possible. As a workaround, you could create a new workflow and invoke it in your Main.

sure but i want it to assign activity name only if exception occur so i want to save my sub modul name / aka my try catch activity name