{
  "name": "Business Card OCR",
  "nodes": [
    {
      "parameters": {
        "options": {
          "allowFileUploads": true
        }
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        -180,
        0
      ],
      "id": "91fe8ddf-48fb-4d2f-9f9c-7b367277f7c2",
      "name": "When chat message received",
      "webhookId": "6c2188b8-2daf-4aed-afb9-b45a55eb0016",
      "notesInFlow": true
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "The attached image is a business card. Using the information on this business card, list the following for the owner:\nName, company name, phone number, address, and E-mail,\n\nand output them in this format:\n\n{\n\t\"1005414\": \"Name\",\n\t\"1005415\": \"Company\",\n\t\"1005416\": \"Phone Number\",\n\t\"1005417\": \"Address\",\n\t\"1005418\": \"E-mail\"\n}",
        "options": {
          "systemMessage": "**IMPORTANT**：The response should only include the content between { and }, do not include any kind of notes or control characters such like \"```\" or \"json\". If any information is not able to be find in the image, simply output as \"null\". "
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.8,
      "position": [
        220,
        0
      ],
      "id": "7d540da7-36a8-45a1-96b8-20d2cf9e9a07",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "modelName": "models/gemini-1.5-flash",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        220,
        220
      ],
      "id": "3bbe9f77-30b3-4e8e-b5e0-aad59c64dd5a",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "id": "PjcpFVnJdJOfrxd6",
          "name": "Google Gemini(PaLM) Api account"
        }
      }
    },
    {
      "parameters": {
        "content": "## AI\nUse Gemini to analyze the name, company, phone number, address, and email from a business card and output the information to specified fields.",
        "height": 120,
        "width": 420
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        140,
        360
      ],
      "id": "8b7a4a8a-6ae1-4c02-9ffc-848bdd6a64fe",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "action": "createNewData",
        "method": "fieldMode",
        "form": "jaykeeRagic/n8n/3",
        "entries": {
          "fieldMode_map": [
            {
              "entries_field": "1005414",
              "entries_value": "={{ $json['1005414'] }}"
            },
            {
              "entries_field": "1005415",
              "entries_value": "={{ $json['1005415'] }}"
            },
            {
              "entries_field": "1005416",
              "entries_value": "={{ $json['1005416'] }}"
            },
            {
              "entries_field": "1005417",
              "entries_value": "={{ $json['1005417'] }}"
            },
            {
              "entries_field": "1005418",
              "entries_value": "={{ $json['1005418'] }}"
            }
          ]
        }
      },
      "type": "n8n-nodes-ragic.ragic",
      "typeVersion": 1,
      "position": [
        940,
        0
      ],
      "id": "64f9cdf9-f21d-42ad-b994-b6b340541770",
      "name": "Ragic",
      "credentials": {
        "ragicApi": {
          "id": "pt1mwghbNfrCX1TX",
          "name": "Ragic account"
        }
      }
    },
    {
      "parameters": {
        "content": "## Write to Ragic\nCreate a new record in the specified form.",
        "height": 100,
        "width": 220
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        940,
        180
      ],
      "id": "d7afbad7-9123-4c90-b026-f20412f427f3",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "mode": "raw",
        "jsonOutput": "={{ $json.output }}",
        "options": {
          "dotNotation": false
        }
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        640,
        0
      ],
      "id": "d00fd173-0e97-40ce-a49d-311c259c9c10",
      "name": "Edit Fields",
      "alwaysOutputData": false
    }
  ],
  "pinData": {},
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ragic": {
      "main": [
        []
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Ragic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "c0c6dbe8-d8c0-4f22-a27d-83f1d089a44d",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "fbfca0660bcf0e8b7388d2ddcfc9eae88e97c39282817fb567eeb6c2801a5111"
  },
  "id": "wUoPrVliBj3MCK5B",
  "tags": []
}