How can I export from a nodered flow json file, the property "connection" of nodes with type "MSSQL"

I have an exported flows.json file of a NodeRed flow, and from that I want to parse the property "connection" of nodes with type "MSSQL". But I get always empty result. I have noticed when debugging the code that a property like "connection" is not existing programatically, although I can see it in the Nodered UI. Instead I can just parse the property "MSSQLCN" which is something like an ident number. How can I parse the node property "connection" via code using this "MSSQLCN" ident number? After that I would search for the global configuration node with that name and parse the properites "Server" and "Database"

using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json.Linq;

class Program
{
    static void Main(string[] args)
    {
        try
        {
            // Specify the path to the Node-RED flow.json file
            string inputFilePath = @"C:\flow.json";
            string outputFilePath = @"C:\result.txt";

            // Read the JSON file
            string jsonContent = File.ReadAllText(inputFilePath);

            // Parse the JSON content
            JArray flowArray = JArray.Parse(jsonContent);

            // List to store connection properties of MSSQL nodes
            List<string> mssqlConnections = new List<string>();

            // Iterate through each node in the flow
            foreach (JObject node in flowArray)
            {
                // Check if the node type is MSSQL
                if (node["type"]?.ToString() == "MSSQL")
                {
                    // Get the connection property
                    string connection = node["connection"]?.ToString();

                    if (!string.IsNullOrEmpty(connection))
                    {
                        mssqlConnections.Add(connection);
                    }
                }
            }

            // Write the connection properties to the output file
            File.WriteAllLines(outputFilePath, mssqlConnections);

            Console.WriteLine($"Extraction completed. Results saved to {outputFilePath}");
        }
        catch (Exception ex)
        {
            Console.WriteLine("An error occurred: " + ex.Message);
        }
    }
}

A flow is a flat array of objects with each object representing a node.
Every node object in a flow array has at minimum a type and an id
When a node has a shared config node, it is identified by its id

e.g regular-node has a shared config and its id is 100000001

[
  { "type": "regular-node", "id": "100000000", "nodeConfig": "100000001" },
  { "type": "conf-node", "id": "100000001", "host": "localhost", "port": 1234, ... },
]

There is no strict convention (i.e. connection may or may not be the property that identifies the "Connection"). It is entirely down to how the node author wrote the contrib package.