Should all workflow variables be Serializable? What kind of serialization is used here?
Workflow variables are not required to be serializable as workflow state is rebuilt in the case of failure by replaying events in the workflow execution history (event sourcing). But if you use a workflow variable as input to an activity or return it in response to query handler, then it needs to be serializable.
Does Temporal persist the input and output of an Activity as well?
Yes. All activity input parameters are serialized and stored within
ActivityScheduledEvent in execution history.
Is thread persistence achieved through variable persistence and rebuilding the state using event sourcing?
I’m not sure I fully understand the question. The only restriction Temporal puts on workflow logic is, that it needs to be deterministic. Temporal SDK also has a scheduler which executes multi-threaded code in deterministic manner. In the case of failure we replay your workflow code using execution history and considering it is deterministic we end up exact same state along with all threads, local variables and call-stack.
In a decision step between two activities, if the decision is made on an external state, should that call also be encapsulated in an activity?
Anything which pulls in state from external source needs to be called within