{
  "name": "Transform email responses with GPT-4O Mini and Telegram human-in-the-loop",
  "nodes": [
    {
      "id": "4f162485-7021-436f-ad6e-762d7a7dcb86",
      "name": "Email Received (IMAP)",
      "type": "n8n-nodes-base.emailReadImap",
      "position": [
        -1160,
        400
      ]
    },
    {
      "id": "de1cf386-a4c9-4ec9-a398-117ad7de8b03",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        -720,
        400
      ]
    },
    {
      "id": "857f71d6-76b9-44b9-8b4e-22aa1c3775c7",
      "name": "Extract Text",
      "type": "n8n-nodes-base.set",
      "position": [
        -940,
        480
      ]
    },
    {
      "id": "64182ab8-9ad7-493c-a81c-41b505905050",
      "name": "Send Chick-fil-A Style Reply",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        840,
        560
      ]
    },
    {
      "id": "370254c1-2025-436b-8434-975a20147142",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        620,
        560
      ]
    },
    {
      "id": "3d921b92-5f5c-44e1-b1e3-ae2fe7629af1",
      "name": "Chick-Fil-A Translator",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        260,
        280
      ]
    },
    {
      "id": "9c6c536d-acae-4549-ad99-7d73cf459c71",
      "name": "Extract Email",
      "type": "n8n-nodes-base.code",
      "position": [
        -940,
        280
      ]
    },
    {
      "id": "d64efd1c-f977-4451-94fc-7cd559683a14",
      "name": "Ask for Response",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -200,
        300
      ]
    },
    {
      "id": "3f4bc908-c160-4188-b379-e932b5506674",
      "name": "If Respond",
      "type": "n8n-nodes-base.if",
      "position": [
        40,
        300
      ]
    },
    {
      "id": "906dc2e6-df99-4fe6-a35d-e2444b60b165",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -260,
        120
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "This will send a Telegram message and wait for a response\n\nMake sure to set your Chat ID and Bot credentials"
      }
    },
    {
      "id": "6658a91d-ccdb-4ef0-b672-a01f3beb2325",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        260,
        100
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "This is the translator\n\nAdd credentials and modify prompt if your use-case is hyper specific"
      }
    },
    {
      "id": "399978fc-c851-45ea-a666-6fd6533295b2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        780,
        740
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "Remember to add your email & subject (optional)"
      }
    },
    {
      "id": "f20f34ec-4d8f-42ea-b785-1a9c2c2f0c4c",
      "name": "🚀 SETUP GUIDE - START HERE",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1300,
        20
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "📋 SETUP CHECKLIST:\n\n✅ 1. Configure IMAP credentials for email reading\n✅ 2. Set up SMTP credentials for email sending\n✅ 3. Create Telegram bot and get Chat ID\n✅ 4. Add OpenAI API key\n✅ 5. Update YOUR_E"
      }
    },
    {
      "id": "b1b6e37b-8d8b-4638-bbfd-c3d7a03598e5",
      "name": "📧 EMAIL SETUP",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1300,
        200
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "STEP 1: Configure Email Credentials\n\n• IMAP: For reading incoming emails\n• SMTP: For sending replies\n\nCommon IMAP settings:\n• Gmail: imap.gmail.com:993\n• Outlook: imap-mail.outlook.com:993\n• Yahoo: im"
      }
    },
    {
      "id": "284470f1-c4bd-4b55-9b74-39879c75121c",
      "name": "💬 TELEGRAM SETUP",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -260,
        -240
      ],
      "parameters": {
        "width": null,
        "height": 340,
        "content": "STEP 2: Setup Telegram Bot\n\n1. Message @BotFather on Telegram\n2. Use /newbot command\n3. Follow instructions to create bot\n4. Copy the bot token\n5. Get your Chat ID:\n   • Message @userinfobot\n   • Copy"
      }
    },
    {
      "id": "5cc3a026-7ed7-4b1d-8d39-34518fc08d72",
      "name": "🤖 OPENAI SETUP",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        260,
        -320
      ],
      "parameters": {
        "width": null,
        "height": 400,
        "content": "STEP 3: Configure OpenAI\n\n1. Get OpenAI API key from platform.openai.com\n2. Add credentials to n8n\n3. Model: gpt-4o-mini (cost-effective)\n\n💡 CUSTOMIZE THE PROMPT:\nChange the system message to match yo"
      }
    },
    {
      "id": "cc4e9eb6-a683-46eb-947d-bcc23fdf0b5d",
      "name": "🔄 WORKFLOW FLOW",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        540
      ],
      "parameters": {
        "width": null,
        "height": 400,
        "content": "WORKFLOW PROCESS:\n\n1. 📨 Email arrives → IMAP reads it\n2. 📤 Extract sender email + text content\n3. 📱 Send to Telegram for human review\n4. 👤 Human types response in Telegram\n5. 🤖 AI translates to Chick-"
      }
    },
    {
      "id": "13ac71b6-1b23-49d1-ae57-ba0dde82aa76",
      "name": "⚙️ FINAL CONFIGURATION",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        780,
        20
      ],
      "parameters": {
        "width": null,
        "height": 420,
        "content": "STEP 4: Final Setup\n\n📧 Send Email Node:\n• Replace YOUR_EMAIL with your sending email\n• Update SUBJECT line as needed\n• Test email delivery\n\n🧪 TESTING:\n1. Send test email to monitored inbox\n2. Check Te"
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          },
          {
            "node": "Ask for Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Send Chick-fil-A Style Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Respond": {
      "main": [
        [
          {
            "node": "Chick-Fil-A Translator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Extract Email": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ask for Response": {
      "main": [
        [
          {
            "node": "If Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Received (IMAP)": {
      "main": [
        [
          {
            "node": "Extract Email",
            "type": "main",
            "index": 0
          },
          {
            "node": "Extract Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chick-Fil-A Translator": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}