{
  "name": "Joining different datasets",
  "nodes": [
    {
      "id": "9971f7ab-ecc3-468b-8eb9-b58491b660bd",
      "name": "On clicking 'execute'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        1040,
        360
      ]
    },
    {
      "id": "bb212963-9b6f-434c-9777-3360fb456d4b",
      "name": "Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1320,
        600
      ],
      "parameters": {
        "width": 1020,
        "height": 360,
        "content": "# 3. Add items from B below items from A\n"
      }
    },
    {
      "id": "cc9461f1-1016-4ef5-bc10-525942c45047",
      "name": "Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1320,
        -200
      ],
      "parameters": {
        "width": 1020,
        "height": 380,
        "content": "# 1. Keep items from A if there's a match in B\n"
      }
    },
    {
      "id": "09a68f64-5b2d-43a8-acff-7c26817cc025",
      "name": "Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1320,
        200
      ],
      "parameters": {
        "width": 1020,
        "height": 380,
        "content": "# 2. Enrich items from A with matching data from B"
      }
    },
    {
      "id": "bcf0c7df-fb64-4ef8-9d75-300ff9b55f40",
      "name": "Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        175,
        235
      ],
      "parameters": {
        "width": 740,
        "height": 460,
        "content": "# Aggregating data with the Merge node\n\n## The merge node is one of the most useful nodes in n8n. In this workflow we show how to merge data from two different sources (similar to SQL joins).\n\n## The "
      }
    },
    {
      "id": "b418defd-f58f-4f53-9bac-b1e6611151dc",
      "name": "Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1855,
        335
      ],
      "parameters": {
        "width": 480,
        "height": null,
        "content": "## Adds the quantity needed to each ingredient in the recipe\n\n## Similar to SQL Left join\n\n"
      }
    },
    {
      "id": "017b5902-865e-4481-98d2-0a969cc09482",
      "name": "Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1855,
        -65
      ],
      "parameters": {
        "width": 480,
        "height": null,
        "content": "## This will keep only the ingredients needed that are also in stock\n\n## Similar to SQL Inner join"
      }
    },
    {
      "id": "e2b46667-da41-4448-a74d-3aa095f72619",
      "name": "Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1855,
        695
      ],
      "parameters": {
        "width": 480,
        "height": 200,
        "content": "## This will create a super band by merging Queen and Led Zeppelin\n\n## Similar to SQL Union All \n(more flexible as not requires all fields to be the same)"
      }
    },
    {
      "id": "9726c9cc-cab1-44f8-8c62-2b80899af4aa",
      "name": "Ingredients in stock from recipe",
      "type": "n8n-nodes-base.merge",
      "position": [
        1600,
        -20
      ]
    },
    {
      "id": "42367b1e-8a5d-4b0c-bfd3-8bb3f1b63df9",
      "name": "Super Band",
      "type": "n8n-nodes-base.merge",
      "position": [
        1620,
        760
      ]
    },
    {
      "id": "b4a756d8-a729-4add-aafa-9868738a6790",
      "name": "A. Ingredients Needed",
      "type": "n8n-nodes-base.code",
      "position": [
        1360,
        -100
      ]
    },
    {
      "id": "eb69abdc-cb89-43c5-bcd6-5f1f6383b391",
      "name": "B. Ingredients in stock",
      "type": "n8n-nodes-base.code",
      "position": [
        1360,
        40
      ]
    },
    {
      "id": "b01228b8-c860-4725-a0e1-00b4c11218cc",
      "name": "Merge recipe",
      "type": "n8n-nodes-base.merge",
      "position": [
        1620,
        380
      ]
    },
    {
      "id": "fdb8a9cb-8a85-4a9a-bd2f-c9711178333f",
      "name": "A. Ingredients",
      "type": "n8n-nodes-base.code",
      "position": [
        1360,
        300
      ]
    },
    {
      "id": "2ca385e5-6833-49fa-b052-abc8583b4a7a",
      "name": "B. Recipe quantities",
      "type": "n8n-nodes-base.code",
      "position": [
        1360,
        440
      ]
    },
    {
      "id": "8e4c7da8-3700-4b1f-b937-739debf7aba4",
      "name": "A. Queen",
      "type": "n8n-nodes-base.code",
      "position": [
        1360,
        680
      ]
    },
    {
      "id": "260c7a0a-43ba-46aa-bfa8-cbbb66aca493",
      "name": "B. Led Zeppelin",
      "type": "n8n-nodes-base.code",
      "position": [
        1360,
        820
      ]
    }
  ],
  "connections": {
    "A. Queen": {
      "main": [
        [
          {
            "node": "Super Band",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "A. Ingredients": {
      "main": [
        [
          {
            "node": "Merge recipe",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "B. Led Zeppelin": {
      "main": [
        [
          {
            "node": "Super Band",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "B. Recipe quantities": {
      "main": [
        [
          {
            "node": "Merge recipe",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "A. Ingredients Needed": {
      "main": [
        [
          {
            "node": "Ingredients in stock from recipe",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On clicking 'execute'": {
      "main": [
        [
          {
            "node": "A. Ingredients Needed",
            "type": "main",
            "index": 0
          },
          {
            "node": "B. Ingredients in stock",
            "type": "main",
            "index": 0
          },
          {
            "node": "A. Ingredients",
            "type": "main",
            "index": 0
          },
          {
            "node": "B. Recipe quantities",
            "type": "main",
            "index": 0
          },
          {
            "node": "A. Queen",
            "type": "main",
            "index": 0
          },
          {
            "node": "B. Led Zeppelin",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "B. Ingredients in stock": {
      "main": [
        [
          {
            "node": "Ingredients in stock from recipe",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}