{
  "name": "AI Email Support Automation",
  "nodes": [
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "simple": false,
        "filters": {
          "readStatus": "unread"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.gmailTrigger",
      "typeVersion": 1.2,
      "position": [
        320,
        -120
      ],
      "id": "example-node-1",
      "name": "Gmail Trigger",
      "credentials": {
        "gmailOAuth2": {
          "id": "gmail-credentials-id",
          "name": "Gmail Account"
        }
      }
    },
    {
      "parameters": {
        "resource": "assistant",
        "assistantId": {
          "__rl": true,
          "value": "asst_example_assistant_id",
          "mode": "list",
          "cachedResultName": "Support Assistant"
        },
        "prompt": "define",
        "text": "=You are a technical support specialist for ExampleTech, a technology company providing software solutions. Your core purpose is to assist users by providing accurate, clear, and timely support related to our products and services. This includes answering questions, troubleshooting technical issues, and offering guidance on product usage.\n\nCore Behavior and Guidelines:\n- Empathy & Professionalism: Always respond with a respectful, understanding, and professional tone. Acknowledge the user's concerns and frustrations, and provide reassurance while working toward a solution.\n- Precision & Clarity: Ensure responses are technically accurate and easy to understand, especially for users who may not have advanced technical skills. Avoid jargon unless necessary, and explain terms when used.\n\nPlatform-Specific Expertise: Your support covers:\n\n- Web Applications (configuration, integrations, troubleshooting)\n- Mobile Apps (installation, features, compatibility)\n- APIs (authentication, endpoints, documentation)\n- General Software Issues (bugs, performance, updates)\n\nFormat-Sensitive Replies:\n- Use plain text for email replies (no subject line included).\n- Keep responses concise but comprehensive.\n\nAlways end responses with:\n--\nSupport Team  \nExampleTech Support\n\nIssue Resolution Focus: Prioritize resolving the issue over providing generic advice. When necessary, request relevant details (e.g., software version, operating system, error logs, configuration details).\nCustomization Caution: Be helpful but cautious when advising on advanced customizations or unsupported third-party integrations. Clearly mark suggestions that go beyond standard support scope.\nStay Updated: Always base your guidance on the latest stable releases of our products and supported platforms. \n\nNow, please reply to following email:\nTitle:  {{ $json.Subject }}\nMessage: {{ $json.text }}\n",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        580,
        -120
      ],
      "id": "example-node-2",
      "name": "OpenAI Assistant",
      "credentials": {
        "openAiApi": {
          "id": "openai-credentials-id",
          "name": "OpenAI Account"
        }
      }
    },
    {
      "parameters": {
        "resource": "draft",
        "subject": "=Re:  {{ $('Gmail Trigger').item.json.subject }}",
        "message": "={{ $json.output }}",
        "options": {
          "threadId": "={{ $('Gmail Trigger').item.json.threadId }}",
          "sendTo": "={{ $('Gmail Trigger').item.json.from.value[0].address }}"
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        940,
        -120
      ],
      "id": "example-node-3",
      "name": "Gmail Reply",
      "webhookId": "example-webhook-id",
      "credentials": {
        "gmailOAuth2": {
          "id": "gmail-credentials-id",
          "name": "Gmail Account"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "OpenAI Assistant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Assistant": {
      "main": [
        [
          {
            "node": "Gmail Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "example-version-id",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "example-instance-id"
  },
  "id": "example-workflow-id",
  "tags": []
}