{
  "name": "AI-Powered Crop Advisory and Farm Decision Support Automation System",
  "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": "596bb88b-63e9-46a3-a1fe-be2384a18990",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "zHTJ5AI7kBmTnuvv",
          "name": "InfyOm"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Format Farmer Data').item.json.phone }}"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        864,
        240
      ],
      "id": "411e4f0a-cdeb-45b8-b959-3c60e091ead2",
      "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": "9ebf6b9e-e944-4068-8598-282d9ad7a5e0",
      "name": "Farmer Input Form Trigger",
      "webhookId": "8d4b91bc-14c5-4e32-a348-ddc6bd14eaf4"
    },
    {
      "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": "03e979f5-38ef-4f58-9cda-c1428367e96f",
      "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": "66327aab-6d5f-46eb-980f-5b3f9c235c3a",
      "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": "cfbe6520-bbf4-4766-8a75-e2887d3a0c2e",
      "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 India\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": "5518d0bc-54f7-4d03-a351-c37f16b019d6",
      "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": "fdc19396-a3e3-4dac-a878-ae88c18fb82e",
      "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": "7005a32f-bfde-4082-b15b-4fc123c518c3",
      "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": "a0fb1c9e-68dc-480f-92a4-7f7966cc6ebd",
      "name": "Generate Farmer Message"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1pnH-LPSvx9Zzfc4rn3aT-ylYxk2ZqdgFiRydEpS1mb0",
          "mode": "list",
          "cachedResultName": "Smart Farming Data",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pnH-LPSvx9Zzfc4rn3aT-ylYxk2ZqdgFiRydEpS1mb0/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pnH-LPSvx9Zzfc4rn3aT-ylYxk2ZqdgFiRydEpS1mb0/edit#gid=0"
        },
        "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": "c9a781f1-25d4-48de-a097-4ec858ce5641",
      "name": "Store Farmer Data",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wQXWIxCRV7ybbbNL",
          "name": "heet - Google Sheets"
        }
      }
    },
    {
      "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": "d67ad9ce-95b7-4c0c-bea8-b364e2e6f8d4",
      "name": "Send WhatsApp Alert",
      "credentials": {
        "twilioApi": {
          "id": "R6dWWTJFACSwxUGe",
          "name": "tarec16401 - twilio account"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        416,
        576
      ],
      "id": "b9d75e0c-5b26-4b97-bf4e-c77037f46985",
      "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": "c4261add-812d-4d86-a406-3edf258c88e9",
      "name": "OpenAI Chat Model1",
      "credentials": {
        "openAiApi": {
          "id": "zHTJ5AI7kBmTnuvv",
          "name": "InfyOm"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Loop Over Items').item.json['Phone Number'] }}"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        1088,
        864
      ],
      "id": "0e8298ba-39be-44eb-ae03-7d9d2ae534f9",
      "name": "Simple Memory1"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        0,
        576
      ],
      "id": "0d23af6c-8db8-4b09-82a8-dd061823647a",
      "name": "Daily Scheduler"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1pnH-LPSvx9Zzfc4rn3aT-ylYxk2ZqdgFiRydEpS1mb0",
          "mode": "list",
          "cachedResultName": "Smart Farming Data",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pnH-LPSvx9Zzfc4rn3aT-ylYxk2ZqdgFiRydEpS1mb0/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pnH-LPSvx9Zzfc4rn3aT-ylYxk2ZqdgFiRydEpS1mb0/edit#gid=0"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        208,
        576
      ],
      "id": "7714a761-7291-4b6a-bb49-aba106780173",
      "name": "Get Farmers Data",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "wQXWIxCRV7ybbbNL",
          "name": "heet - Google Sheets"
        }
      }
    },
    {
      "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": "c9156ae1-8636-4cb2-8b41-de53c1492fd2",
      "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": "ce5bec80-f2cd-42c2-95e1-d5decde71f39",
      "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 India\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": "8fffa17d-70dc-4cbe-8bed-4243fb668727",
      "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": "ef03b515-a97c-4c51-a30a-6e627251c90b",
      "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": "91d7b79e-384b-4a32-8eb8-38ee2b84cf0f",
      "name": "WhatsApp Alert",
      "credentials": {
        "twilioApi": {
          "id": "R6dWWTJFACSwxUGe",
          "name": "tarec16401 - 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 (Sheet mathi)\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 (previous node mathi)\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": "418bb399-ea3c-4b8c-a260-31ad54ea2733",
      "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": "b26db162-2d1e-415a-b231-f02c6cb541cc",
      "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": "9b2000fb-d239-41e9-9538-532bdc6c7d84",
      "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": "9067ec1f-0eed-46e3-8930-00afcbea5c80",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## Google Sheet\nhttps://docs.google.com/spreadsheets/d/1pnH-LPSvx9Zzfc4rn3aT-ylYxk2ZqdgFiRydEpS1mb0/edit?gid=0#gid=0",
        "width": 640
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -352,
        256
      ],
      "id": "7ddfb7a6-6a4a-4f03-bef7-c299415619ce",
      "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": "d595b9ed-d9b6-4d97-8c32-9e90ffa8bb4a",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "9272721148ea09184b6bbb7ce6219dab088562dd450e2df8280d57c2e34c7d84"
  },
  "id": "sczCLAkM7Tef4Hk1",
  "tags": []
}