Python Sandbox: Only Workflows or Also Activities?

So, I read things about the Sandbox and things needing to be predictable/repeatable. That makes sense to me, otherwise the generators wouldn’t be resumeable without reexecuting all steps…

Now the question is… are the activities also put through the same sandbox shenanigans? It sounds a little onerous or even performance degrading, especially if you have to reestablish database connections for every execution of an activity.

So I would hope the activities are outside the sandbox, right?

I think I found a sort-of answer to my question. Apparently it is a very good idea to pass through the module that contains your activities. That would imply they are not running inside the repeatability sandbox!

Correct, sandbox is only needed for workflows (which also means that it can often be best practice to write workflows in a separate file). Workflows must be deterministic, activities can do basically anything.