{
  "name": "recipes-ingredients-google-sheets",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -2496,
        528
      ],
      "id": "7c804050-9b54-4063-9168-e40a2b5c7d25",
      "name": "When clicking \u2018Execute workflow\u2019"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1gyQ9yWDir-WXZ-nDJhBFutzsHDuNIGbUUR6jhGreIB8",
          "mode": "list",
          "cachedResultName": "ingredients",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gyQ9yWDir-WXZ-nDJhBFutzsHDuNIGbUUR6jhGreIB8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sayfa1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gyQ9yWDir-WXZ-nDJhBFutzsHDuNIGbUUR6jhGreIB8/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "Status"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -1856,
        528
      ],
      "id": "770d6627-a285-4b4b-96da-ed5fc7de84a5",
      "name": "Get row(s) in sheet",
      "retryOnFail": false,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -1072,
        528
      ],
      "id": "24ebcdd7-57d0-4c82-a03f-b2ebedc043e3",
      "name": "Loop Over Items"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=\u00dcr\u00fcn ad\u0131: {{ $json.Name }}\n\nG\u00f6rev: Yukar\u0131daki kurallara g\u00f6re bu \u00fcr\u00fcn i\u00e7in JSON \u00fcret.",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "Sen bir i\u00e7erik \u00fcretim ajan\u0131s\u0131n. \u00c7IKTI FORMATIN KES\u0130NL\u0130KLE YALNIZCA GE\u00c7ERL\u0130 JSON OLMALIDIR.\nMarkdown, kod blo\u011fu, a\u00e7\u0131klama, ek metin YOK.\n\nG\u00f6rev: Verilen \u00fcr\u00fcn i\u00e7in T\u00fcrk\u00e7e bir ba\u015fl\u0131k, a\u00e7\u0131klama ve anahtar kelimeler \u00fcret.\n\nJSON \u015eEMASI (zorunlu):\n{\n  \"title\": \"string, 50-60 karakter\",\n  \"description\": \"string, 140-150 karakter\",\n  \"keywords\": [\"string\", \"string\", \"string\", ...] // 5 ila 7 kelime\n}\n\nKurallar:\n- Sadece {\"title\": \"...\", \"description\": \"...\", \"keywords\": [...]} anahtarlar\u0131n\u0131 d\u00f6nd\u00fcr.\n- Ba\u015fl\u0131k (title) YALNIZCA \u00fcr\u00fcn ad\u0131 + varsa bilimsel ad\u0131 parantez i\u00e7inde olmal\u0131d\u0131r.\n  Ba\u015fl\u0131kta ba\u015fka s\u0131fat, a\u00e7\u0131klama, slogan, ek bilgi, noktalama veya tire (-) kullan\u0131lamaz.\n  \u2705 \u00d6rnek do\u011fru: \"Domates (Solanum lycopersicum)\"\n  \u274c Yanl\u0131\u015f: \"Domates (Solanum lycopersicum) - K\u0131rm\u0131z\u0131 ve Lezzetli Sebze\"\n- A\u00e7\u0131klama tek sat\u0131r olmal\u0131, dolgu s\u00f6zc\u00fck yok.\n- Keywords T\u00fcrk\u00e7e, sebze ile do\u011frudan ilgili 5\u20137 kelime olmal\u0131.\n- Uzunluk kurallar\u0131n\u0131 kat\u0131 uygula.\n- JSON d\u0131\u015f\u0131na \u00e7\u0131kma, yorum ekleme, fazladan alan ekleme.\n\n\u00c7\u0131kt\u0131 \u00f6rne\u011fi:\n{\n  \"title\":\"Domates (Solanum lycopersicum)\",\n  \"description\":\"Domates, k\u0131rm\u0131z\u0131 rengi ve etli dokusuyla \u00f6ne \u00e7\u0131kar; likopen, C ve K vitamini i\u00e7erir. Salata ve soslarda do\u011fal tat ve besleyici de\u011fer sunar.\",\n  \"keywords\":[\"domates\",\"sebze\",\"likopen\",\"salata\",\"sos\",\"k\u0131rm\u0131z\u0131\",\"besleyici\"]\n}\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        -496,
        544
      ],
      "id": "8a3bedb1-babe-49ea-8398-3de7e52961c6",
      "name": "AI Agent1",
      "retryOnFail": true,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "model": "openai/gpt-4.1",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        -496,
        800
      ],
      "id": "d90d3cfc-0cf9-4689-a1f3-341ddfd0fe40",
      "name": "OpenRouter Chat Model1",
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n  \"title\": \"string\",\n  \"description\": \"string\",\n  \"keywords\": [\"string\"]\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        -352,
        800
      ],
      "id": "1a5b0c21-cf52-4cac-843a-d2b9e7d67274",
      "name": "Structured Output Parser"
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1gyQ9yWDir-WXZ-nDJhBFutzsHDuNIGbUUR6jhGreIB8",
          "mode": "list",
          "cachedResultName": "ingredients",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gyQ9yWDir-WXZ-nDJhBFutzsHDuNIGbUUR6jhGreIB8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sayfa1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gyQ9yWDir-WXZ-nDJhBFutzsHDuNIGbUUR6jhGreIB8/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Title": "={{ $json.output.title }}",
            "Description": "={{ $json.output.description }}",
            "Keywords": "={{ $json.output.keywords }}",
            "row_number": "={{ $('Get row(s) in sheet').item.json.row_number }}",
            "ProcessEndTime": "={{ new Date().toISOString() }}",
            "ProcessStatus": "COMPLETED",
            "ProcessLastUpdateTime": "={{ new Date().toISOString() }}",
            "ProcessCurrentStage": "AI",
            "Status": "1"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "Order",
              "displayName": "Order",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Name",
              "displayName": "Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Title",
              "displayName": "Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Description",
              "displayName": "Description",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Keywords",
              "displayName": "Keywords",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "displayName": "Status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "ProcessStartTime",
              "displayName": "ProcessStartTime",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "ProcessLastUpdateTime",
              "displayName": "ProcessLastUpdateTime",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "ProcessEndTime",
              "displayName": "ProcessEndTime",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "ProcessCurrentStage",
              "displayName": "ProcessCurrentStage",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "ProcessStatus",
              "displayName": "ProcessStatus",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "ProcessErrorDetails",
              "displayName": "ProcessErrorDetails",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        336,
        528
      ],
      "id": "05a8f4a0-0cee-4e4e-bec4-ca903fb61416",
      "name": "Update row in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1gyQ9yWDir-WXZ-nDJhBFutzsHDuNIGbUUR6jhGreIB8",
          "mode": "list",
          "cachedResultName": "ingredients",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gyQ9yWDir-WXZ-nDJhBFutzsHDuNIGbUUR6jhGreIB8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sayfa1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gyQ9yWDir-WXZ-nDJhBFutzsHDuNIGbUUR6jhGreIB8/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Status": "-1",
            "row_number": "={{ $('Loop Over Items').item.json.row_number }}",
            "ProcessLastUpdateTime": "={{ new Date().toISOString() }}",
            "ProcessEndTime": "={{ new Date().toISOString() }}",
            "ProcessCurrentStage": "AI",
            "ProcessStatus": "ERROR"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "Order",
              "displayName": "Order",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Name",
              "displayName": "Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Title",
              "displayName": "Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Description",
              "displayName": "Description",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Keywords",
              "displayName": "Keywords",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Status",
              "displayName": "Status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "ProcessStartTime",
              "displayName": "ProcessStartTime",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "ProcessLastUpdateTime",
              "displayName": "ProcessLastUpdateTime",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "ProcessEndTime",
              "displayName": "ProcessEndTime",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "ProcessCurrentStage",
              "displayName": "ProcessCurrentStage",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "ProcessStatus",
              "displayName": "ProcessStatus",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "ProcessErrorDetails",
              "displayName": "ProcessErrorDetails",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "ApiPostStaus",
              "displayName": "ApiPostStaus",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "ApiPostDate",
              "displayName": "ApiPostDate",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        352,
        1152
      ],
      "id": "fbb05f4a-d71a-4023-8ec2-bd0cb22aa29d",
      "name": "Update row in sheet1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1gyQ9yWDir-WXZ-nDJhBFutzsHDuNIGbUUR6jhGreIB8",
          "mode": "list",
          "cachedResultName": "ingredients",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gyQ9yWDir-WXZ-nDJhBFutzsHDuNIGbUUR6jhGreIB8/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sayfa1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gyQ9yWDir-WXZ-nDJhBFutzsHDuNIGbUUR6jhGreIB8/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "ProcessCurrentStage": "FIELD",
            "ProcessStatus": "COMPLETED",
            "row_number": "={{ $json.row_number }}",
            "ProcessLastUpdateTime": "={{ new Date().toISOString() }}",
            "ProcessStartTime": "={{ new Date().toISOString() }}"
          },
          "matchingColumns": [
            "row_number"
          ],
          "schema": [
            {
              "id": "Order",
              "displayName": "Order",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Name",
              "displayName": "Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Title",
              "displayName": "Title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Description",
              "displayName": "Description",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Keywords",
              "displayName": "Keywords",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "ProcessStartTime",
              "displayName": "ProcessStartTime",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "ProcessLastUpdateTime",
              "displayName": "ProcessLastUpdateTime",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "ProcessEndTime",
              "displayName": "ProcessEndTime",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "ProcessCurrentStage",
              "displayName": "ProcessCurrentStage",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "ProcessStatus",
              "displayName": "ProcessStatus",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "ProcessErrorDetails",
              "displayName": "ProcessErrorDetails",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -848,
        336
      ],
      "id": "15e38e47-817a-406f-80c3-30e1b11b6b3f",
      "name": "Update row in sheet3",
      "retryOnFail": false,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Update row in sheet3",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update row in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet1": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet3": {
      "main": [
        []
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e2725069-6d23-4d86-9021-efadb5df789c",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "OZAfkZHEUzV8Ciwv",
  "tags": []
}