For workflows, you can use one of these:
System.log("Root workflow name: " + workflow.rootWorkflow.name); System.log("Current workflow name: " + workflow.currentWorkflow.name);
For scripting actions, try the following (note: this is a bit low-level, implementation-specific code that may change in future versions)
var actionName = arguments.callee.name.substr(6); System.log("Currently running action: " + this.name + "." + actionName);