{
  "name": "Automated receipt processing for cashback with Jotform, Gemini 2.5 & Notion",
  "nodes": [
    {
      "id": "fafc18fe-9ffe-42d1-aa6e-16d2c44b0bab",
      "name": "JotForm Trigger",
      "type": "n8n-nodes-base.jotFormTrigger",
      "position": [
        -2896,
        480
      ]
    },
    {
      "id": "53c0d83e-9711-4b81-b738-70919a4c764e",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -1760,
        768
      ]
    },
    {
      "id": "6a8cba61-0195-44d7-a8e6-c6ab918918ab",
      "name": "OCR.Space",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1856,
        480
      ]
    },
    {
      "id": "3794d88d-02db-4183-94f2-05d9cbcf8358",
      "name": "Fetch All Receipts",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2688,
        480
      ]
    },
    {
      "id": "6cc27de0-4bcf-4fc6-8bfc-27044cfa482d",
      "name": "Fetch Receipt File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2272,
        480
      ]
    },
    {
      "id": "a3580172-cbe7-41e3-9c8c-cf965050f75e",
      "name": "Gets Last Receipt",
      "type": "n8n-nodes-base.code",
      "position": [
        -2480,
        480
      ]
    },
    {
      "id": "12f9b49f-e973-4e2e-afa0-63b2488becc0",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1424,
        752
      ]
    },
    {
      "id": "1aee2b39-2516-48ec-8b24-2565eb6974ce",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1616,
        480
      ]
    },
    {
      "id": "29d1089d-f09b-4380-a9fd-20c79bb16b4e",
      "name": "Customer Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -656,
        224
      ]
    },
    {
      "id": "f4e533e6-db38-48aa-acb6-544b16a6a915",
      "name": "Marketing Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -656,
        496
      ]
    },
    {
      "id": "e4f93b36-e5df-4e62-a7c1-2565459d49f8",
      "name": "Add info to Database",
      "type": "n8n-nodes-base.notion",
      "position": [
        -944,
        384
      ]
    },
    {
      "id": "e20517ed-2f08-4b8b-bf81-41cd7fb23eea",
      "name": "Is There's cashback",
      "type": "n8n-nodes-base.if",
      "position": [
        -1216,
        480
      ]
    },
    {
      "id": "36c305f5-efa7-4849-9f1e-1c384f8c4833",
      "name": "Convert Image to base64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -2064,
        480
      ]
    },
    {
      "id": "7199729e-da73-4c70-a0a2-6a67815a890b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3008,
        400
      ],
      "parameters": {
        "width": 272,
        "height": null,
        "content": "Starts the workflow upon form submission; provides customer and initial purchase data."
      }
    },
    {
      "id": "b8601130-a266-4e72-af38-bd759db0457f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2720,
        400
      ],
      "parameters": {
        "width": 176,
        "height": null,
        "content": "Requests the list of all uploaded receipt files from the JotForm API."
      }
    },
    {
      "id": "2db6bf7f-be22-4476-bb72-2d5ad7ae16bc",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2528,
        400
      ],
      "parameters": {
        "width": 192,
        "height": 176,
        "content": "Extracts the URL for the most recently uploaded receipt from the file list.\n"
      }
    },
    {
      "id": "7c1b00ae-e1c9-495e-81ed-1adfd2f68317",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2320,
        400
      ],
      "parameters": {
        "width": 176,
        "height": 176,
        "content": "Downloads the actual receipt image file using the extracted URL.\n"
      }
    },
    {
      "id": "2b3df853-ea8b-4d31-9299-776f78841213",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2128,
        400
      ],
      "parameters": {
        "width": 208,
        "height": 176,
        "content": "Encodes the downloaded image into a base64 string, preparing it for OCR.\n"
      }
    },
    {
      "id": "c0e1412d-ad4d-4946-b831-521736cb267a",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1904,
        400
      ],
      "parameters": {
        "width": 192,
        "height": 176,
        "content": "Converts the receipt image into plain, readable text.\n"
      }
    },
    {
      "id": "85a4879c-6f96-4f97-be8f-80c14382a5e9",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1696,
        400
      ],
      "parameters": {
        "width": 368,
        "height": null,
        "content": "Uses Gemini to clean the raw OCR text, identify XQ products, and extract structured data like prices and cashback."
      }
    },
    {
      "id": "b6e73eed-0bba-47e4-9935-ab0bfb029f2f",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1280,
        400
      ],
      "parameters": {
        "width": 272,
        "height": null,
        "content": "A conditional check; it only allows the workflow to proceed if the calculated cashback is greater than zero.\n"
      }
    },
    {
      "id": "384f6f49-6402-4ebf-865f-1bd2bfdbfb84",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        320
      ],
      "parameters": {
        "width": 224,
        "height": null,
        "content": "Logs the customer details and the calculated cashback amount to a Notion database.\n"
      }
    },
    {
      "id": "00d037bc-7d84-4e71-b696-894de6e0a4f4",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        160
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "Sends a confirmation email to the customer detailing their earned cashback reward.\n"
      }
    },
    {
      "id": "99b4585d-9f9a-4f88-93f2-8163fa3d7522",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        416
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "Sends an internal email notification with all transaction details to the marketing team for tracking."
      }
    },
    {
      "id": "af05870d-bd52-4b37-9a54-f1e49ef16963",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2992,
        -368
      ],
      "parameters": {
        "width": 1024,
        "height": 736,
        "content": "# JotForm Setup Guide\n\n\n## ⚡ Step 1: Link with the Webhook\n\n\n* **1. Log in to your JotForm account, select your Cashback Form, and navigate to Settings.**\n\n* **2. Go to Integrations and search for Web"
      }
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Is There's cashback",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OCR.Space": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JotForm Trigger": {
      "main": [
        [
          {
            "node": "Fetch All Receipts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gets Last Receipt": {
      "main": [
        [
          {
            "node": "Fetch Receipt File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch All Receipts": {
      "main": [
        [
          {
            "node": "Gets Last Receipt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Receipt File": {
      "main": [
        [
          {
            "node": "Convert Image to base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is There's cashback": {
      "main": [
        [
          {
            "node": "Add info to Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add info to Database": {
      "main": [
        [
          {
            "node": "Customer Email",
            "type": "main",
            "index": 0
          },
          {
            "node": "Marketing Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Image to base64": {
      "main": [
        [
          {
            "node": "OCR.Space",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}