{
  "name": "WhatsApp receipt OCR & AI data extraction with Twilio, LlamaParse & Gemini",
  "nodes": [
    {
      "id": "3d154638-8a76-4006-9eb8-cb4c4ac551e4",
      "name": "Webhook3",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -3264,
        1024
      ]
    },
    {
      "id": "4723f47e-4192-4f08-bc71-a0063ba19870",
      "name": "If5",
      "type": "n8n-nodes-base.if",
      "position": [
        -1264,
        224
      ]
    },
    {
      "id": "71f84019-8a7b-42e2-abed-7375903f4cfc",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        -1040,
        384
      ]
    },
    {
      "id": "34ff5654-e5b8-4975-b61e-be81eae87085",
      "name": "HTTP Request28",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1536,
        224
      ]
    },
    {
      "id": "d8d24b43-a3c2-4db8-b25e-9e7c54f6dfc7",
      "name": "HTTP Request29",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1776,
        224
      ]
    },
    {
      "id": "c21433f2-c6be-4889-9229-229632e1e814",
      "name": "HTTP Request17",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1424,
        -48
      ]
    },
    {
      "id": "a717a933-8de0-41ae-bec6-3a92dfd5a776",
      "name": "HTTP Request18",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -96,
        -96
      ]
    },
    {
      "id": "845b9bb8-0f4e-402d-987c-c0f76e1a11d8",
      "name": "HTTP Request30",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1008,
        96
      ]
    },
    {
      "id": "cc3ac676-a194-4e2e-bac1-da7a4c55a6fa",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -400,
        400
      ]
    },
    {
      "id": "25322de5-1b5e-4066-a8fb-b1fc7620f87e",
      "name": "HTTP Request5",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2208,
        1216
      ]
    },
    {
      "id": "447bb8ac-e92e-495d-99dd-e3c9f38d798c",
      "name": "Google Gemini Chat Model5",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -560,
        400
      ]
    },
    {
      "id": "6adfe435-d353-4a01-a812-5514d2a553ee",
      "name": "Upload file2",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1776,
        1264
      ]
    },
    {
      "id": "82128d99-a421-4d1f-bbea-f2cf6a145eee",
      "name": "Append row in sheet2",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2432,
        1216
      ]
    },
    {
      "id": "43bbff2d-f8cc-43cf-bb2b-0f7a879be4d2",
      "name": "Update row in sheet4",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2224,
        1264
      ]
    },
    {
      "id": "45ebc70d-7607-49c3-bbba-2a9121b7d168",
      "name": "Update row in sheet5",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1520,
        160
      ]
    },
    {
      "id": "9495e485-9e5c-408c-b6cd-45f266d9514c",
      "name": "HTTP Request6",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1744,
        160
      ]
    },
    {
      "id": "b3dd632d-178d-4699-abd7-c9980c8d69b8",
      "name": "Basic LLM Chain3",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -496,
        112
      ]
    },
    {
      "id": "a4292084-421c-480b-bec0-9d040d7961d7",
      "name": "Structured Output Parser3",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -128,
        432
      ]
    },
    {
      "id": "057914d2-ad00-4edd-a192-7d5083e67ec3",
      "name": "Code4",
      "type": "n8n-nodes-base.code",
      "position": [
        272,
        144
      ]
    },
    {
      "id": "3b0550c1-4a1e-4faa-ad60-1d9ec442e1a5",
      "name": "HTTP Request7",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2656,
        1216
      ]
    },
    {
      "id": "ada46948-8237-4c9d-b3a8-c49527eb3bd9",
      "name": "Code5",
      "type": "n8n-nodes-base.code",
      "position": [
        1072,
        96
      ]
    },
    {
      "id": "7dafcd20-9587-4155-bd7b-e350974aa75e",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        848,
        160
      ]
    },
    {
      "id": "4230f3ac-57a9-4803-b304-c9c89d8c3fa5",
      "name": "Merge2",
      "type": "n8n-nodes-base.merge",
      "position": [
        1296,
        160
      ]
    },
    {
      "id": "5efbcb46-320d-4b4e-b381-ebad2c70b760",
      "name": "Merge3",
      "type": "n8n-nodes-base.merge",
      "position": [
        2512,
        736
      ]
    },
    {
      "id": "3d82e7e7-4c4c-45e7-b114-1e93561fdd36",
      "name": "Share file1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2000,
        1264
      ]
    },
    {
      "id": "44718e64-3da1-4ef6-b1bb-c106928e1ef5",
      "name": "HTTP Request19",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1968,
        160
      ]
    },
    {
      "id": "52bc56ad-05e0-4f96-8835-ea91d828a9a5",
      "name": "Switch1",
      "type": "n8n-nodes-base.switch",
      "position": [
        -2880,
        1008
      ]
    },
    {
      "id": "ceae7c32-f29e-4eea-b9b0-be58615eaa71",
      "name": "HTTP Request20",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2672,
        208
      ]
    },
    {
      "id": "c3d5c9f6-725f-46d1-89f4-11269309d6a2",
      "name": "HTTP Request21",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2656,
        464
      ]
    },
    {
      "id": "083d882a-b5df-4523-bc8f-52cb9b9ba65c",
      "name": "Update row in sheet9",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2352,
        208
      ]
    },
    {
      "id": "1048ad77-4811-402e-884e-05deabefd1e0",
      "name": "Update row in sheet10",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -2352,
        464
      ]
    },
    {
      "id": "bd854f28-e7d3-4d3e-adb3-2cccf4a1c662",
      "name": "Update row in sheet11",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2192,
        160
      ]
    },
    {
      "id": "adc15966-a6be-4e17-8efb-54ca89df359a",
      "name": "HTTP Request22",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2432,
        1440
      ]
    },
    {
      "id": "e3a593bf-f02a-49ee-819f-44db52722929",
      "name": "HTTP Request24",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1520,
        -64
      ]
    },
    {
      "id": "1c2e6943-603d-45a1-ad81-d2300ae8c73b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1904,
        -16
      ],
      "parameters": {
        "width": null,
        "height": 400,
        "content": "## Quick reply yes/no . SID from twilio"
      }
    },
    {
      "id": "b6a1ea69-737d-4b60-be7b-9c909c68d7d3",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1728,
        -16
      ],
      "parameters": {
        "width": 150,
        "height": 400,
        "content": "## extracted values. no yes/no buttons"
      }
    },
    {
      "id": "0468f643-6409-482a-937a-805fd49cebba",
      "name": "Google Gemini Chat Model6",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -64,
        672
      ]
    },
    {
      "id": "21c455f1-522a-4b86-8739-552d8364e022",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3392,
        -112
      ],
      "parameters": {
        "width": 460,
        "height": 960,
        "content": "## Try It Out!\nThis template shows how to automate the extraction of key information from receipts or invoices using OCR and AI. Receipts sent through WhatsApp are processed automatically and stored i"
      }
    },
    {
      "id": "3ebdb98b-9c0a-4a09-a77e-ee933c3c4058",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2720,
        -112
      ],
      "parameters": {
        "width": 672,
        "height": 784,
        "content": "## Send quick reply asking the user to confirm if the OCR ed information is accurate or not\n\nContains yes / No buttons\n\nYou need to define the quick reply template inside Twilio. \nWait for WhatsApp to"
      }
    },
    {
      "id": "dcab754f-4397-4be2-a4f6-9fe4f3ef2fe2",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1824,
        -112
      ],
      "parameters": {
        "width": 960,
        "height": 800,
        "content": "## OCR pooling mechanism using LlamaParse "
      }
    },
    {
      "id": "298b25a3-7598-4cd2-80fd-abf9bb6f90be",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        -80
      ],
      "parameters": {
        "width": 736,
        "height": 464,
        "content": "## Calculate tax if not specified on the receipt"
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Code5",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge2",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "If5": {
      "main": [
        [
          {
            "node": "HTTP Request30",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "HTTP Request28",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code4": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code5": {
      "main": [
        [
          {
            "node": "Merge2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge2": {
      "main": [
        [
          {
            "node": "Update row in sheet5",
            "type": "main",
            "index": 0
          },
          {
            "node": "HTTP Request24",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch1": {
      "main": [
        [
          {
            "node": "HTTP Request20",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request21",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook3": {
      "main": [
        [
          {
            "node": "Switch1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Share file1": {
      "main": [
        [
          {
            "node": "Update row in sheet4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file2": {
      "main": [
        [
          {
            "node": "Share file1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request5": {
      "main": [
        [
          {
            "node": "Upload file2",
            "type": "main",
            "index": 0
          },
          {
            "node": "HTTP Request29",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request6": {
      "main": [
        [
          {
            "node": "HTTP Request19",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request7": {
      "main": [
        [
          {
            "node": "Append row in sheet2",
            "type": "main",
            "index": 0
          },
          {
            "node": "HTTP Request22",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request19": {
      "main": [
        [
          {
            "node": "Update row in sheet11",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request20": {
      "main": [
        [
          {
            "node": "Update row in sheet9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request21": {
      "main": [
        [
          {
            "node": "Update row in sheet10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request28": {
      "main": [
        [
          {
            "node": "If5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request29": {
      "main": [
        [
          {
            "node": "HTTP Request28",
            "type": "main",
            "index": 0
          },
          {
            "node": "HTTP Request17",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request30": {
      "main": [
        [
          {
            "node": "Basic LLM Chain3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain3": {
      "main": [
        [
          {
            "node": "Code4",
            "type": "main",
            "index": 0
          },
          {
            "node": "HTTP Request18",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet2": {
      "main": [
        [
          {
            "node": "HTTP Request5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet4": {
      "main": [
        [
          {
            "node": "Merge3",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Update row in sheet5": {
      "main": [
        [
          {
            "node": "HTTP Request6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain3",
            "type": "ai_languageModel",
            "index": 1
          }
        ]
      ]
    },
    "Update row in sheet11": {
      "main": [
        [
          {
            "node": "Merge3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model5": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain3",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model6": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser3",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser3": {
      "ai_outputParser": [
        [
          {
            "node": "Basic LLM Chain3",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}