getData() is typically used to retrieve the actual data objects within the context of the microflow. These are typically persistent objects like Entity instances from the Mendix database, which represent your application's core data structures.
getVariable() is used for retrieving non-persistent values or variables (such as primitive data types, strings, numbers, boolean, or references to more transient objects) that are stored in the context of a microflow.