{
  "name": "Create e-mail responses with Fastmail and OpenAI",
  "nodes": [
    {
      "id": "082d1828-72b1-48c0-8426-c8051c29f0db",
      "name": "Session",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -20,
        -20
      ]
    },
    {
      "id": "d7dc4c50-c8fc-4999-918d-5d357567ed14",
      "name": "Get Mailbox IDs",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        200,
        -20
      ]
    },
    {
      "id": "31be3c1c-f4c5-4309-92b3-2fd0a3fcecc6",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        400,
        -20
      ]
    },
    {
      "id": "93de4dad-70d6-4e16-b351-7c540c3a4bfa",
      "name": "Email Trigger (IMAP)",
      "type": "n8n-nodes-base.emailReadImap",
      "position": [
        -20,
        -240
      ]
    },
    {
      "id": "41e77a60-622f-426c-a50c-e0df03c53208",
      "name": "Get fields from source email",
      "type": "n8n-nodes-base.set",
      "position": [
        200,
        -240
      ]
    },
    {
      "id": "f9d1a529-1377-456b-8357-d37fb3fe74f9",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        400,
        -240
      ]
    },
    {
      "id": "c421ddc9-b230-499c-a11d-a20a68d30c5b",
      "name": "Filter for drafts folder",
      "type": "n8n-nodes-base.filter",
      "position": [
        560,
        -20
      ]
    },
    {
      "id": "ef19fde4-cf8c-4e19-912e-822611c18056",
      "name": "upload draft email",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1000,
        -120
      ]
    },
    {
      "id": "f4ecb64a-c978-4aa3-943e-c4a7f0592b91",
      "name": "gather data for draft email",
      "type": "n8n-nodes-base.set",
      "position": [
        800,
        -120
      ]
    },
    {
      "id": "ca868672-85bd-4e2e-b2c6-6c6c69b78b24",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -580,
        -560
      ],
      "parameters": {
        "width": 493.9330818092735,
        "height": 695.2489786026621,
        "content": "## Workflow Description:\nThis n8n workflow automates the drafting of email replies for Fastmail using OpenAI's GPT-4 model. Here’s the overall process:\n\n1. **Email Monitoring**: The workflow continuou"
      }
    },
    {
      "id": "c4273cc2-1ac2-43f4-bcd1-7f42d3109373",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        -560
      ],
      "parameters": {
        "width": 722.928660826031,
        "height": 285.5319148936168,
        "content": "## Prerequisites:\n1. **IMAP Email Account**: You need to configure an IMAP email account in n8n to monitor incoming emails.\n2. **Fastmail API Credentials**: A Fastmail account with JMAP API enabled. Y"
      }
    }
  ],
  "connections": {
    "OpenAI": {
      "main": [
        [
          {
            "node": "Session",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Session": {
      "main": [
        [
          {
            "node": "Get Mailbox IDs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Filter for drafts folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Mailbox IDs": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Trigger (IMAP)": {
      "main": [
        [
          {
            "node": "Get fields from source email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter for drafts folder": {
      "main": [
        [
          {
            "node": "gather data for draft email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "gather data for draft email": {
      "main": [
        [
          {
            "node": "upload draft email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get fields from source email": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}