Combining multiple markdowns into one

Sorry for being MIA - got drawn away by corporate work. This is so helpful, thank you Wouter! I will try to integrate this into my flow tomorrow. I will then share my result with you here. Super pumpted Thanks again and sorry for the late reply!

Wouter - i replied to your post with the loop, but my reply is still under review by the admins.
While the post is pending: I do remember you saying that the openai node always needs a string to feed into, it cannot be an array. Now you applied two methods:

  1. way earlier you took an array → added a code node to turn it into a string → then gave it to the openai node
  2. now you used a different method, you took the array → and used a ‘stringify’ function to turn that array.

May i ask, when do you use which? Because i tried to substitute them, use them, but it doesnt seem to work interchangably.

Yeah apologies for the confusion. I was in a rush before a meeting so tried to see if the quick and dirty would work. Ideally my enhancement to my example will be to convert the json into markdown as thats what LLMs understand much better and I think this is why my example only compares one of the companies. Ill try and work on a fix and send a reply

1 Like

Here is the updated version with clean up input. In my rush I missed the fact that the structered output had to be an array and not an object, hence it only returend the first comparison. I also changed the model to claude as it does a much better job at understading data and comparisons

Results:

[
  {
    "output": [
      {
        "companiesCompared": "Concert Golf Partners vs Acushnet Company",
        "comparison": "These companies operate in completely different segments of the golf industry. Concert Golf Partners is a private club owner-operator that acquires and modernizes upscale private golf and country clubs, focusing on debt-free ownership and facility improvements. In contrast, Acushnet Company is a publicly-listed manufacturer that produces premium golf equipment and apparel under brands like Titleist and FootJoy. Their industry focuses differ significantly - Concert Golf specializes in private-club acquisition, ownership and management, while Acushnet focuses on golf equipment and apparel manufacturing. Their products and services are entirely complementary rather than competitive: Concert Golf provides all-cash club acquisitions, debt elimination, facility management and reciprocal play networks for club members, while Acushnet manufactures golf balls, clubs, shoes, gloves, apparel and accessories that would be used at Concert Golf's facilities."
      },
      {
        "companiesCompared": "Concert Golf Partners vs Topgolf Callaway Brands Corp.",
        "comparison": "These companies represent traditional versus modern approaches to the golf business. Concert Golf Partners focuses on acquiring and operating upscale private golf and country clubs in a traditional ownership model, emphasizing debt-free club ownership and facility modernization. Topgolf Callaway Brands combines tech-enabled golf entertainment venues with equipment and lifestyle brands, representing a more innovative, experiential approach to golf. Their industry focuses reflect this difference - Concert Golf specializes in private-club acquisition, ownership and management, while Topgolf focuses on golf entertainment, equipment and lifestyle brands. Their services target different market segments: Concert Golf provides traditional club services including acquisitions, debt elimination, operations management and reciprocal play networks for private club members, while Topgolf offers entertainment venues with driving ranges, ball-tracking technology, franchising opportunities, plus equipment brands like Callaway and lifestyle apparel through TravisMathew."
      },
      {
        "companiesCompared": "Concert Golf Partners vs Troon",
        "comparison": "Both companies operate in golf club management but with fundamentally different business models. Concert Golf Partners is an owner-operator that acquires and owns 36 debt-free private clubs across the United States, investing its own capital for modernization and membership growth. Troon, headquartered in Scottsdale, is the world's largest golf and hospitality management company that provides services to 900+ locations globally without ownership. Their industry focuses show this distinction - Concert Golf specializes in private-club acquisition, ownership and management, while Troon focuses on golf course, club and hospitality management services. Concert Golf's services center on ownership activities like all-cash acquisitions, debt elimination, capital improvements and member reciprocal play networks, while Troon provides comprehensive management services including daily operations, agronomy, food & beverage, HR, finance, IT services, and extends beyond golf to tennis management and event services."
      },
      {
        "companiesCompared": "Concert Golf Partners vs GOLFTEC",
        "comparison": "These companies serve entirely different aspects of golf participation and improvement. Concert Golf Partners owns and operates upscale private golf and country clubs, focusing on providing premium facilities and experiences for club members. GOLFTEC, founded in 1995, is the world leader in golf instruction and club fitting, helping individual golfers improve their game through technology-driven lessons and custom equipment. Their industry focuses reflect these different roles - Concert Golf specializes in private-club acquisition, ownership and management, while GOLFTEC focuses on golf instruction and club fitting services. Concert Golf provides facility-based services including club acquisitions, debt elimination, operations management and reciprocal play networks, while GOLFTEC offers personalized instruction using proprietary motion-capture technology (TECSWING & OptiMotion), swing evaluations, improvement plans, custom club fitting with 250+ brand options, and mobile apps for continued improvement."
      },
      {
        "companiesCompared": "Acushnet Company vs Topgolf Callaway Brands Corp.",
        "comparison": "Both companies are major players in golf equipment, but they represent different strategic approaches to the market. Acushnet Company is a focused, publicly-listed manufacturer that concentrates exclusively on premium golf equipment and apparel through established brands like Titleist and FootJoy, maintaining its position as the global leader in high-performance golf products. Topgolf Callaway Brands operates a diversified portfolio that combines tech-enabled entertainment venues with equipment and lifestyle brands, representing a broader approach to golf and active lifestyle markets. Their industry focuses show this strategic difference - Acushnet focuses purely on golf equipment and apparel manufacturing, while Topgolf focuses on golf entertainment, equipment and lifestyle brands. Acushnet's products remain traditional and premium (Titleist golf balls and clubs, FootJoy shoes and apparel, Scotty Cameron putters), while Topgolf combines entertainment venues and ball-tracking technology with equipment brands (Callaway clubs and balls) and lifestyle apparel (TravisMathew, OGIO), targeting both traditional golfers and entertainment-seeking consumers."
      }
    ]
  }
]
2 Likes

Wouter!!! You’re killing it! Thanks, this worked! I think one of the big issues really was to move the ai agent to the anthorpic model. I still need to tailer the output to what i need, but that should hopefully be a piece of cake (famous last words haha) Thanks again for your cotninous handholding on this !! I learned so much in this process, thanks!

1 Like

Yeah I think you were on the right track from the beginning and we might just have needed a bigger context window like Claude.

1 Like

One of my biggest take aways was when you shared your thoguths on how n8n operates regarding an object strings vs arrays and how agents can only work with object strings. Again, I draw my hat.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.