{
  "name": "AI Crop Advisory for Farmers",
  "nodes": [
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "gpt-4o-mini"
        },
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [
        672,
        240
      ],
      "id": "e9fecbd5-ab4b-4d05-a5ec-4b35b3889bc5",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "SsnwT4koLkkkT1th",
          "name": "OpenAI account"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Format Farmer Data').item.json.phone }}"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        864,
        240
      ],
      "id": "78cb0ae6-a32c-4f05-8741-9ab4cb4972a0",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "formTitle": "AI Farming Help Form 🌱",
        "formDescription": "Fill your farming details to get daily smart advice on crop, weather, and market updates directly on WhatsApp.",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Farmer Name",
              "requiredField": true
            },
            {
              "fieldLabel": "Phone Number (WhatsApp)",
              "fieldType": "number",
              "requiredField": true
            },
            {
              "fieldLabel": "Select Your Crop",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Cotton"
                  },
                  {
                    "option": "Wheat"
                  },
                  {
                    "option": "Rice"
                  },
                  {
                    "option": "Sugarcane"
                  },
                  {
                    "option": "Others"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldLabel": "Village / City",
              "requiredField": true
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.5,
      "position": [
        0,
        0
      ],
      "id": "12070baf-0a65-4f80-82ff-91d57251ca39",
      "name": "Farmer Input Form Trigger",
      "webhookId": "053bc0cc-1758-486a-9e2c-f50b147f9af8"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "3aa51864-d7c3-4c2d-8b4e-9cd761ff8717",
              "name": "farmer_name",
              "value": "={{ $json['Farmer Name'] }}",
              "type": "string"
            },
            {
              "id": "6b37bbd3-8d27-4d1d-820c-4ac4142a3092",
              "name": "phone",
              "value": "={{ $json['Phone Number (WhatsApp)'] }}",
              "type": "number"
            },
            {
              "id": "6b688e15-5d96-4486-b7b6-7cee741188e3",
              "name": "crop",
              "value": "={{ $json['Select Your Crop'] }}",
              "type": "string"
            },
            {
              "id": "d7e9631c-c882-4e50-87ef-5a8715cc2aae",
              "name": "location",
              "value": "={{ $json['Village / City'] }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        208,
        0
      ],
      "id": "109acb74-a41d-4969-a7c2-995cce441db3",
      "name": "Format Farmer Data"
    },
    {
      "parameters": {
        "url": "=https://api.openweathermap.org/data/2.5/weather?q={{$json[\"location\"]}}&appid=dfff9bcd2f00a631ea783a6c5421010c&units=metric",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        416,
        0
      ],
      "id": "93354429-aee0-41f8-a5ff-c14288563e36",
      "name": "Fetch Weather Data"
    },
    {
      "parameters": {
        "jsCode": "let data = $input.first().json;\n\nlet crop = data.crop?.toLowerCase() || \"\";\n\n// Crop-based soil advice map\nlet soilMap = {\n  cotton: \"Cotton grows well in black soil with good drainage.\",\n  wheat: \"Wheat grows best in loamy soil with good fertility.\",\n  rice: \"Rice requires clayey soil that retains water.\",\n  sugarcane: \"Sugarcane grows well in deep, rich loamy soil.\",\n};\n\n// Default advice\nlet soilAdvice = soilMap[crop] || \"General soil suitable for most crops.\";\n\n// Return\nreturn [\n  {\n    json: {\n      ...data,\n      soilAdvice: soilAdvice\n    }\n  }\n];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        624,
        0
      ],
      "id": "85d0afd1-0605-47dc-bc33-fd695520f056",
      "name": "Soil Analysis Logic"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=You are an agriculture expert.\n\nFarmer:\nName: {{ $('Format Farmer Data').item.json.farmer_name }}\nCrop: {{ $('Format Farmer Data').item.json.crop }}\nLocation: {{ $('Format Farmer Data').item.json.location }}\n\nWeather:\nTemperature: {{$json.main.temp}}\nHumidity: {{$json.main.humidity}}\n\nSoil:\n{{$json.soilAdvice}}\n\nTask:\nGive response in this JSON format:\n\n{\n  \"advice\": \"...\",\n  \"market_price\": \"...\",\n  \"trend\": \"increasing or decreasing\"\n}\n\nRules:\n- Market price should be realistic for the farmer's local market\n- Based on crop\n- Keep answer short\n\n---\n\n# 🛠 OPTIONAL STRONG FIX (clean parsing)\n\nReplace this line:\n```js\nlet aiText = data.output || \"{}\";",
        "hasOutputParser": true,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        832,
        0
      ],
      "id": "68738a5c-471e-4d1c-8cc1-b6b8208868e5",
      "name": "AI Farming Advisor"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"advice\": { \"type\": \"string\" },\n    \"market_price\": { \"type\": \"string\" },\n    \"trend\": { \"type\": \"string\" }\n  }\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        1056,
        240
      ],
      "id": "372d4bf1-ebf7-452a-ac30-a74492bb1735",
      "name": "AI Response Formatter"
    },
    {
      "parameters": {
        "jsCode": "let data = $input.first().json;\n\nlet advice = \"\";\n\nif (data.output?.trend === \"increasing\") {\n  advice = \"Hold crop, price will rise.\";\n} else {\n  advice = \"Sell now.\";\n}\n\nreturn [\n  {\n    json: {\n      ...data,\n      sellingAdvice: advice\n    }\n  }\n];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1184,
        0
      ],
      "id": "48ac3374-dd7a-4329-8adc-5b685e4b9469",
      "name": "Market Decision Logic"
    },
    {
      "parameters": {
        "jsCode": "// Get data from different nodes\nlet editData = $items(\"Format Farmer Data\")[0].json;\nlet weatherData = $items(\"Fetch Weather Data\")[0].json;\nlet aiData = $items(\"AI Farming Advisor\")[0].json;\nlet currentData = $input.first().json;\n\n// Safe values\nlet name = editData.farmer_name || \"Farmer\";\nlet location = editData.location || \"N/A\";\nlet crop = editData.crop || \"N/A\";\n\nlet temp = weatherData.main?.temp || \"N/A\";\nlet humidity = weatherData.main?.humidity || \"N/A\";\n\n// ✅ AI structured output\nlet aiOutput = aiData.output || {};\n\nlet advice = aiOutput.advice || \"No advice available\";\nlet marketPrice = aiOutput.market_price || \"N/A\";\nlet trend = aiOutput.trend || \"stable\";\n\n// ✅ Trend display improve\nlet trendText = \"Stable Market ➖\";\n\nif (trend === \"increasing\") {\n  trendText = \"Increasing Price 📈\";\n} else if (trend === \"decreasing\") {\n  trendText = \"Decreasing Price 📉\";\n}\n\n// Selling advice\nlet sellingAdvice = currentData.sellingAdvice || \"No suggestion\";\n\n// Final message\nlet message = `🌾 Hello ${name}\n\n📍 Location: ${location}\n🌱 Crop: ${crop}\n\n🌦️ Weather:\nTemp: ${temp}°C\nHumidity: ${humidity}%\n\n🤖 AI Advice:\n${advice}\n\n💰 Market Price:\n${marketPrice}\n\n📊 Market Trend:\n${trendText}\n\n📈 Suggestion:\n${sellingAdvice}\n`;\n\n// Return output\nreturn [\n  {\n    json: {\n      ...currentData,\n      message: message\n    }\n  }\n];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1392,
        0
      ],
      "id": "0cf6619a-e761-4ff6-bb27-443300c72c3b",
      "name": "Generate Farmer Message"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1pnH-LPSvx9Zzfc4rn3aT-ylYxk2ZqdgFiRydEpS1mb0",
          "mode": "list",
          "cachedResultName": "Smart Farming Data"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Farmer Name": "={{ $('Format Farmer Data').item.json.farmer_name }}",
            "Phone Number": "={{ $('Format Farmer Data').item.json.phone }}",
            "Crop": "={{ $('Format Farmer Data').item.json.crop }}",
            "Location": "={{ $('Format Farmer Data').item.json.location }}",
            "Market Price": "={{ $json.output.market_price }}",
            "Advice": "={{ $json.output.advice }}",
            "Trend": "={{ $json.output.trend }}",
            "Temperature": "={{ $('Soil Analysis Logic').item.json.main.temp }}°C",
            "Humidity": "={{ $('Soil Analysis Logic').item.json.main.humidity }}%",
            "Selling Advice": "={{ $json.sellingAdvice }}",
            "Date": "={{new Date().toLocaleString()}}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "Farmer Name",
              "displayName": "Farmer Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Phone Number",
              "displayName": "Phone Number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Crop",
              "displayName": "Crop",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Location",
              "displayName": "Location",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Temperature",
              "displayName": "Temperature",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Humidity",
              "displayName": "Humidity",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Advice",
              "displayName": "Advice",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Market Price",
              "displayName": "Market Price",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Trend",
              "displayName": "Trend",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Selling Advice",
              "displayName": "Selling Advice",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Date",
              "displayName": "Date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1600,
        0
      ],
      "id": "aad7b559-e527-4dc7-9cf3-749342b623d4",
      "name": "Store Farmer Data",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "Pkc8jJJZleMSmXoy",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "from": "=whatsapp:+14155238886",
        "to": "=whatsapp:+{{ $('Farmer Input Form Trigger').item.json['Phone Number (WhatsApp)'] }}",
        "message": "={{ $json.message }}",
        "options": {}
      },
      "type": "n8n-nodes-base.twilio",
      "typeVersion": 1,
      "position": [
        1808,
        0
      ],
      "id": "eb9b3743-0691-461d-8a64-2af8759dae70",
      "name": "Send WhatsApp Alert",
      "credentials": {
        "twilioApi": {
          "id": "x3JY36aoL50A71ad",
          "name": "Twilio account"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        416,
        576
      ],
      "id": "3ec4b749-bc83-47ab-8696-ecdd928e466b",
      "name": "Loop Over Items"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "gpt-4o-mini"
        },
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [
        896,
        864
      ],
      "id": "ac217872-b16a-435a-a82e-dd7dddbc25e4",
      "name": "OpenAI Chat Model1",
      "credentials": {
        "openAiApi": {
          "id": "SsnwT4koLkkkT1th",
          "name": "OpenAI account"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Loop Over Items').item.json['Phone Number'] }}"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        1088,
        864
      ],
      "id": "b5932b5c-801b-4ffb-a983-720829cf6f35",
      "name": "Simple Memory1"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        0,
        576
      ],
      "id": "126f96dc-78cd-41b8-909a-f96a7b1de998",
      "name": "Daily Scheduler"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1pnH-LPSvx9Zzfc4rn3aT-ylYxk2ZqdgFiRydEpS1mb0",
          "mode": "list",
          "cachedResultName": "Smart Farming Data"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        208,
        576
      ],
      "id": "27379b07-477e-44e1-a65b-25497ed8fceb",
      "name": "Get Farmers Data",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "Pkc8jJJZleMSmXoy",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "url": "=https://api.openweathermap.org/data/2.5/weather?q={{ $json.Location }}&appid=dfff9bcd2f00a631ea783a6c5421010c&units=metric",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        640,
        624
      ],
      "id": "12a703a2-8164-4106-8af5-8da7706f2d35",
      "name": "Fetch Weather"
    },
    {
      "parameters": {
        "jsCode": "let data = $input.first().json;\n\nlet crop = data.crop?.toLowerCase() || \"\";\n\n// Crop-based soil advice map\nlet soilMap = {\n  cotton: \"Cotton grows well in black soil with good drainage.\",\n  wheat: \"Wheat grows best in loamy soil with good fertility.\",\n  rice: \"Rice requires clayey soil that retains water.\",\n  sugarcane: \"Sugarcane grows well in deep, rich loamy soil.\",\n};\n\n// Default advice\nlet soilAdvice = soilMap[crop] || \"General soil suitable for most crops.\";\n\n// Return\nreturn [\n  {\n    json: {\n      ...data,\n      soilAdvice: soilAdvice\n    }\n  }\n];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        848,
        624
      ],
      "id": "d52d610b-66d2-40be-bbcf-a35a059b810c",
      "name": "Soil Analysis"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=You are an agriculture expert.\n\nFarmer:\nName: {{ $('Loop Over Items').item.json['Farmer Name'] }}\nCrop: {{ $('Loop Over Items').item.json['Crop'] }}\nLocation: {{ $('Loop Over Items').item.json['Location'] }}\n\nWeather:\nTemperature: {{$json.main.temp}}\nHumidity: {{$json.main.humidity}}\n\nSoil:\n{{$json.soilAdvice}}\n\nTask:\nGive response in this JSON format:\n\n{\n  \"advice\": \"...\",\n  \"market_price\": \"...\",\n  \"trend\": \"increasing or decreasing\"\n}\n\nRules:\n- Market price should be realistic for the farmer's local market\n- Based on crop\n- Keep answer short\n\n---\n\n# 🛠 OPTIONAL STRONG FIX (clean parsing)\n\nReplace this line:\n```js\nlet aiText = data.output || \"{}\";",
        "hasOutputParser": true,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        1056,
        624
      ],
      "id": "1e0b3c03-9316-4214-9d5f-5244235afae1",
      "name": "Farming Advisor"
    },
    {
      "parameters": {
        "jsCode": "let data = $input.first().json;\n\nlet advice = \"\";\n\nif (data.output?.trend === \"increasing\") {\n  advice = \"Hold crop, price will rise.\";\n} else {\n  advice = \"Sell now.\";\n}\n\nreturn [\n  {\n    json: {\n      ...data,\n      sellingAdvice: advice\n    }\n  }\n];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1408,
        624
      ],
      "id": "35cc39e1-b4ea-4b1b-b1ad-18b03c73d67d",
      "name": "Market Decision"
    },
    {
      "parameters": {
        "from": "=whatsapp:+14155238886",
        "to": "=whatsapp:+{{ $('Loop Over Items').item.json['Phone Number'] }}",
        "message": "={{ $json.message }}",
        "options": {}
      },
      "type": "n8n-nodes-base.twilio",
      "typeVersion": 1,
      "position": [
        1808,
        624
      ],
      "id": "e96b1c4c-a742-45b6-bdec-314cf8181f34",
      "name": "WhatsApp Alert",
      "credentials": {
        "twilioApi": {
          "id": "x3JY36aoL50A71ad",
          "name": "Twilio account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Get data from nodes\n\nlet farmerData = $items(\"Loop Over Items\").json;\nlet weatherData = $items(\"Fetch Weather\")[0].json;\nlet aiData = $items(\"Farming Advisor\")[0].json;\n\n// Farmer data (from the sheet)\nlet name = $('Loop Over Items').first().json['Farmer Name'];\nlet location =  $('Loop Over Items').first().json['Location'];\nlet crop =  $('Loop Over Items').first().json['Crop'];\nlet phone =  $('Loop Over Items').first().json['Phone Number'];\n\n// Weather\nlet temp = weatherData.main?.temp || \"N/A\";\nlet humidity = weatherData.main?.humidity || \"N/A\";\n\n// AI output\nlet aiOutput = aiData.output || {};\n\nlet advice = aiOutput.advice || \"No advice available\";\nlet marketPrice = aiOutput.market_price || \"N/A\";\nlet trend = aiOutput.trend || \"stable\";\n\n// Trend display\nlet trendText = \"Stable Market ➖\";\n\nif (trend === \"increasing\") {\n  trendText = \"Increasing Price 📈\";\n} else if (trend === \"decreasing\") {\n  trendText = \"Decreasing Price 📉\";\n}\n\n// Selling advice (from the previous node)\nlet sellingAdvice = $items(\"Market Decision\")[0]?.json?.sellingAdvice;\n\n// Final message\nlet message = `🌾 Good Morning ${name}\n\n📍 Location: ${location}\n🌱 Crop: ${crop}\n\n🌦️ Weather Update:\nTemp: ${temp}°C\nHumidity: ${humidity}%\n\n🤖 AI Advice:\n${advice}\n\n💰 Market Price:\n${marketPrice}\n\n📊 Market Trend:\n${trendText}\n\n📈 Suggestion:\n${sellingAdvice}\n\nHave a great farming day 🌱🚜`;\n\n// Return\nreturn [\n  {\n    json: {\n      ...farmerData,\n      message: message,\n      phone: phone\n    }\n  }\n];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1600,
        624
      ],
      "id": "eb112c85-001b-46d8-a071-3478a17e6346",
      "name": "Generate Message"
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"advice\": { \"type\": \"string\" },\n    \"market_price\": { \"type\": \"string\" },\n    \"trend\": { \"type\": \"string\" }\n  }\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        1280,
        864
      ],
      "id": "f502157e-c238-4405-b4c2-5d44cb659ea7",
      "name": "Response Formatter"
    },
    {
      "parameters": {
        "content": "## AI Farming Advisory Intake & Real-Time Recommendation System",
        "height": 144,
        "width": 320
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -352,
        -16
      ],
      "id": "b24c5c78-d71a-4042-910b-3ac8a0e1f0f1",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## Automated Daily Farming Advisory, Monitoring & Notification System",
        "height": 144,
        "width": 320
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -336,
        544
      ],
      "id": "f47dddbf-4c6f-4e7a-a74e-b53742a7366e",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## Google Sheet\nCreate your own spreadsheet with these tabs/columns, then select it in the Google Sheets nodes:\n- **Smart Farming Data → Sheet1**: `Farmer Name`, `Phone Number`, `Crop`, `Location`, `Temperature`, `Humidity`, `Advice`, `Market Price`, `Trend`, `Selling Advice`, `Date`",
        "width": 640
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -352,
        256
      ],
      "id": "02e5a511-d6da-47f7-a320-d78f27a6e0ec",
      "name": "Sticky Note2"
    }
  ],
  "pinData": {},
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Farming Advisor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Farming Advisor",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Farmer Input Form Trigger": {
      "main": [
        [
          {
            "node": "Format Farmer Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Farmer Data": {
      "main": [
        [
          {
            "node": "Fetch Weather Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Weather Data": {
      "main": [
        [
          {
            "node": "Soil Analysis Logic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Soil Analysis Logic": {
      "main": [
        [
          {
            "node": "AI Farming Advisor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Farming Advisor": {
      "main": [
        [
          {
            "node": "Market Decision Logic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Response Formatter": {
      "ai_outputParser": [
        [
          {
            "node": "AI Farming Advisor",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Market Decision Logic": {
      "main": [
        [
          {
            "node": "Generate Farmer Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Farmer Message": {
      "main": [
        [
          {
            "node": "Store Farmer Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Farmer Data": {
      "main": [
        [
          {
            "node": "Send WhatsApp Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Fetch Weather",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Farming Advisor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory1": {
      "ai_memory": [
        [
          {
            "node": "Farming Advisor",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Daily Scheduler": {
      "main": [
        [
          {
            "node": "Get Farmers Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Farmers Data": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Weather": {
      "main": [
        [
          {
            "node": "Soil Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Soil Analysis": {
      "main": [
        [
          {
            "node": "Farming Advisor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Farming Advisor": {
      "main": [
        [
          {
            "node": "Market Decision",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Market Decision": {
      "main": [
        [
          {
            "node": "Generate Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Message": {
      "main": [
        [
          {
            "node": "WhatsApp Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Response Formatter": {
      "ai_outputParser": [
        [
          {
            "node": "Farming Advisor",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate"
  },
  "versionId": "0f7062c1-451f-413b-938d-fabc427d51fa",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "f1c26778ec36097a9722a22c47c5e9c01f00b8862dadd0121ec118026a370fa6"
  },
  "id": "lVFj8ClTLefiBqrh",
  "tags": []
}