How to add two links automatically when drag and dropped?

i have node called “For Each” when i drag and drop i want to it have two links automatically, i need some like as shown .please let me know how to do it?

Is the user drag-and-dropping from a Palette? If so, it would be easiest to implement an “ExternalObjectsDropped” DiagramEvent listener that looked at the Nodes that were dropped and added Links as desired.

DiagramEvent | GoJS API documents how in that case the e.subject will be a collection of Parts (probably just Nodes) that the user drag-and-dropped.

You’ll need to figure out how to connect your two new links to the newly added node and how to connect them with any other nodes that are already present in the diagram, if any.