Saving and Loading Linked Objects

I am working on Saving and Loading my game. I was able to save and load various variables, object variables, and positions. I discovered a problem though. Is there a way to save linked objects? Basically I can have any given number of workers at a time and any given number of workstations, and the workstations may have a certain product. So say I have 3 workers, 10 work stations, 3 of them are making a product. But one of these products needs the worker. So he is sent to the workstation and while being sent their. I have the two objects linked with the Advanced/Linked objects. Is their a way to have a object linked to a other object be saved and loaded? Again the worker could be linked to a given workstation and that workstation maybe linked to a product. The product may also be linked to a addon object.
Also is their a way to see what objects are linked to what objects?

You’ll need to give each workstation, worker and product an id that links them together, and then save these. Then link the objects when you recreate them upon load.

Rather than an ID, I would use a parent child relationship in the save structure to know how to describe the link. For example, you could have such a save:

{
  "FreeWorkers":[{"x": 1, "y": 2}],
  "Workbenches": [
    {
      "x": 4,
      "y": 23
    },
    {
      "x": 34,
      "y": 12,
      "worker": {"x": 11, "y": 3}
    }
  ]
}

That way you can recreate normal workers independently, and when creating workbenches back if it had a worker linked to it then you can recreate it and link it with the workspace you are currently recreating.