What are the options for using n8n to generate possible combinations of two databases based on Google Spreadsheet?

  1. Take two Google Spreadsheet.
  2. Select a pre-generated value generation scenario (For example, take values from Webhook).
  3. Generate values and write them to JSON.
    What nodes and their settings are needed?

Sorry do not understand what you want to do exactly. Can you please explain in more detail.

Example:
In one Google Spreadsheet, a list of car brands (Audi, BMW, Ford, Toyota …)
In the third Google Spreadsheet, the name of the car parts (engine, gearbox, headlight, suspension …)
You need to get a JSON file with a list of all possible combinations (Audi engine, BMW engine, Ford engine, Toyota engine … … … Ford suspension, Toyota suspension).

At the output, a JSON file is needed with the following structure:

{
  "new combination": "Audi engine",
  "source 1": "Audi",
  "source 2": "engine"
},
{
  "new combination": "BMW engine",
  "source 1": "BMW",
  "source 2": "engine"
},
{
  "new combination": "Ford engine",
  "source 1": "Ford",
  "source 2": "engine"
}
...
{
  "new combination": "Ford suspension",
  "source 1": "Ford",
  "source 2": "engine"
},
{
  "new combination": "Toyota suspension",
  "source 1": "Toyota",
  "source 2": "engine"
}

I imagine something like this, but I can’t configure the function node, because I don’t know how to write JavaScript code.

Do sadly still not totally understand what you have planned. Especially with the “pre-generated value generation scenario” but maybe the following helps you anyway:

{
  "nodes": [
    {
      "parameters": {
        "functionCode": "return [\n  {\n    json: {\n      brand: 'BMW',\n    }\n  },\n  {\n    json: {\n      brand: 'Ford',\n    }\n  }\n]"
      },
      "name": "Mock-Sheet-Brands",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        800,
        250
      ]
    },
    {
      "parameters": {
        "functionCode": "return [\n  {\n    json: {\n      part: 'engine',\n    }\n  },\n  {\n    json: {\n      part: 'gearbox',\n    }\n  }\n]"
      },
      "name": "Mock-Sheet-Parts",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        800,
        450
      ]
    },
    {
      "parameters": {
        "mode": "multiplex"
      },
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 1,
      "position": [
        1000,
        350
      ]
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "new combination",
              "value": "={{$node[\"Merge\"].json[\"brand\"]}} {{$node[\"Merge\"].json[\"part\"]}}"
            },
            {
              "name": "source 1",
              "value": "={{$node[\"Merge\"].json[\"brand\"]}}"
            },
            {
              "name": "source 2",
              "value": "={{$node[\"Merge\"].json[\"part\"]}}"
            }
          ]
        }
      },
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        1200,
        350
      ]
    },
    {
      "parameters": {
        "path": "webhook",
        "options": {}
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        390,
        350
      ]
    },
    {
      "parameters": {},
      "name": "NoOp",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        600,
        350
      ]
    }
  ],
  "connections": {
    "Mock-Sheet-Brands": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mock-Sheet-Parts": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "NoOp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "NoOp": {
      "main": [
        [
          {
            "node": "Mock-Sheet-Brands",
            "type": "main",
            "index": 0
          },
          {
            "node": "Mock-Sheet-Parts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Yes, that’s exactly what I need.

Perfect, great to hear! Have fun!