In custom activities derived from CodeActivity, the Execute method contains the execution logic. This is where you implement the activity's primary behavior. For NativeActivity, you override Execute differently, and CacheMetadata is for runtime metadata registration, not execution logic. Exec and beginExec are not valid WF4.0 method names.