Passing arbitrary data into a node prior to preprocessing
Node's in D8 work differently to D7. in D7 node was a stdClass object - basically used in the same way an array was assign a value to a key ($node->value). In D8 Node's are proper objects and can't do the same key/value. Instead, how about creating a field on the node and assigning the value to the field, save the node and then view it?