Adding Revit Link to active file

I need a little help here, I am making a tool to add a Revit link to a project, it seems to be working, it makes a link, but then that link isn’t useable or visible to python or dynamo after it’s created, able to succeed using Dynamo so it is possible…
Here you can see the link manager displaying 2 links but only the one not made with my tool appears to Dynamo:

And my code:
`

Load Pyrevit

from pyrevit import revit, DB
doc = revit.doc

Path to the file you want to link

file_path = r’Z:\SEA\Projects\00018.zlab\Data Strategy R&D\Working Files\Office Benchmarking\Revit Files\Office Benchmarking Template.rvt’

Convert the file path to a ModelPath object

model_path = DB.ModelPathUtils.ConvertUserVisiblePathToModelPath(file_path)

Begin a new transaction

transaction = DB.Transaction(doc, “Create Revit Link”)
transaction.Start()

try:
# Create a new instance of RevitLinkOptions
link_options = DB.RevitLinkOptions(True)

# Create a new instance of RevitLinkType
link_type = DB.RevitLinkType.Create(doc, model_path, link_options)

# Commit the transaction
transaction.Commit()

except Exception as ex:
# Rollback the transaction in case of any exception
transaction.RollBack()
raise ex
`

What am I missing here?

Thanks!

Here is my code next to a working Dynamo node for reference:

Ohh I got it, I was forgetting to append hte element list with the new link, here is the solution:

import clr
clr.AddReference('pyrevit')
import pyrevit
from pyrevit import revit, DB

doc = revit.doc

# Path to the file you want to link
file_path = r'Z:\SEA\Projects\00018.zlab\Data Strategy R&D\Working Files\Office Benchmarking\Revit Files\Office Benchmarking Template.rvt'

element_list = list()

# Begin a new transaction
transaction = DB.Transaction(doc, "Create Revit Link")
transaction.Start()

try:
    # Convert the file path to a ModelPath object
    link_path = DB.ModelPathUtils.ConvertUserVisiblePathToModelPath(file_path)

    # Create a new instance of RevitLinkOptions
    link_options = DB.RevitLinkOptions(True)

    # Create a new instance of RevitLinkType
    link_type = DB.RevitLinkType.Create(doc, link_path, link_options)

    # Append the link instance to the element list
    link_instance = DB.RevitLinkInstance.Create(doc, link_type.ElementId)
    element_list.append(link_instance)

    # Commit the transaction
    transaction.Commit()

except Exception as ex:
    # Rollback the transaction in case of any exception
    transaction.RollBack()
    raise ex