8
n8n 한국어amn8n.com

OpenAI 어시스턴트 기반 Gmail 자동 회신 초안 생성

고급

이것은Ticket Management, Multimodal AI분야의자동화 워크플로우로, 23개의 노드를 포함합니다.주로 Set, Code, Gmail, Limit, Markdown 등의 노드를 사용하며. OpenAI 어시스턴트 기반 Gmail 자동 응답 초안 생성

사전 요구사항
  • Google 계정 및 Gmail API 인증 정보
  • 대상 API의 인증 정보가 필요할 수 있음
  • OpenAI API Key
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "nodes": [
    {
      "id": "a99b3164-fe36-4dde-9525-110c1ae08afb",
      "name": "원본을 base64로 변환",
      "type": "n8n-nodes-base.code",
      "position": [
        3320,
        580
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const encoded = Buffer.from($json.raw).toString('base64');\n\nreturn { encoded };"
      },
      "typeVersion": 2
    },
    {
      "id": "f0f731bd-7b2f-4c39-bc06-42fd57bc4ae8",
      "name": "스레드에 이메일 초안 추가",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3580,
        580
      ],
      "parameters": {
        "url": "https://www.googleapis.com/gmail/v1/users/me/drafts",
        "method": "POST",
        "options": {},
        "jsonBody": "={\"message\":{\"raw\":\"{{ $json.encoded }}\", \"threadId\": \"{{ $('Map fields for further processing').item.json[\"threadId\"] }}\"}}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "gmailOAuth2"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "uBcIMfsTtKjexw7I",
          "name": "Gmail (workfloowstutorial@gmail.com)"
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "c1ce3400-4582-46c7-a85d-8fa9c325ff7b",
      "name": "이메일에서 AI 라벨 제거",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3820,
        580
      ],
      "parameters": {
        "resource": "thread",
        "threadId": "={{ $('Map fields for further processing').item.json[\"threadId\"] }}",
        "operation": "removeLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "uBcIMfsTtKjexw7I",
          "name": "Gmail (workfloowstutorial@gmail.com)"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "65f0508a-ca2e-49ce-b02f-ef6505b5e983",
      "name": "스케줄 트리거 (1분)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        960,
        580
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 1
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "ca4a209b-a79d-4911-b69b-1db22808be60",
      "name": "추가 처리를 위한 필드 매핑",
      "type": "n8n-nodes-base.set",
      "position": [
        2620,
        580
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a77b2d79-1e70-410c-a657-f3d618154ea1",
              "name": "response",
              "type": "string",
              "value": "={{ $json.output }}"
            },
            {
              "id": "20850cac-f82c-4f02-84f0-3de31871a5b8",
              "name": "threadId",
              "type": "string",
              "value": "={{ $('Get single message content').item.json[\"threadId\"] }}"
            },
            {
              "id": "d270c18e-39a0-4d87-85f0-cc1ffc9c10ff",
              "name": "to",
              "type": "string",
              "value": "={{ $('Get single message content').item.json[\"from\"][\"text\"] }}"
            },
            {
              "id": "30acb50b-bdde-44bf-803c-76e0ae65f526",
              "name": "subject",
              "type": "string",
              "value": "={{ $('Get single message content').item.json[\"subject\"] }}"
            },
            {
              "id": "88914536-8c25-4877-8914-feab5e32fae3",
              "name": "messageId",
              "type": "string",
              "value": "={{ $('Get threads with specific labels').item.json[\"id\"] }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "93eb3844-f1fe-4b09-bcae-3e372a19ab6f",
      "name": "응답을 HTML로 변환",
      "type": "n8n-nodes-base.markdown",
      "position": [
        2860,
        580
      ],
      "parameters": {
        "mode": "markdownToHtml",
        "options": {
          "simpleLineBreaks": false
        },
        "markdown": "={{ $json.response }}",
        "destinationKey": "response"
      },
      "typeVersion": 1
    },
    {
      "id": "da35eda9-b63e-49f9-8fe8-7517c1445c92",
      "name": "이메일 원본 구성",
      "type": "n8n-nodes-base.set",
      "position": [
        3100,
        580
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "913e9cb1-10de-4637-bf48-40272c7c7fe3",
              "name": "raw",
              "type": "string",
              "value": "=To: {{ $json.to }}\nSubject: {{ $json.subject }}\nContent-Type: text/html; charset=\"utf-8\"\n\n{{ $json.response }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "b667a399-a178-42e3-a587-4eccd2a153d8",
      "name": "스티키 노트",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        460
      ],
      "parameters": {
        "color": 4,
        "width": 420.4803040774015,
        "height": 189.69151356225348,
        "content": "## Reply draft with OpenAI Assistant\nThis workflow automatically transfers content of incoming email messages with specific labels into OpenAI Assitant and returns reply draft. After draft is composed, trigger label is deleted from the thread.\n\n**Please remember to configure your OpenAI Assistant first.**"
      },
      "typeVersion": 1
    },
    {
      "id": "fe47636b-2142-4c40-a937-2ec360b230ae",
      "name": "스티키 노트2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        900,
        460
      ],
      "parameters": {
        "width": 451.41125086385614,
        "height": 313.3056033573073,
        "content": "### Schedule trigger and get emails\nRun the workflow in equal intervals and check for threads with specific labels (trigger labels)."
      },
      "typeVersion": 1
    },
    {
      "id": "c9bfa42c-a045-404d-aebe-d87dceb68f1a",
      "name": "스티키 노트1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        680
      ],
      "parameters": {
        "color": 3,
        "width": 421.0932411886662,
        "height": 257.42916378714597,
        "content": "## ⚠️ Note\n\n1. Complete video guide for this workflow is available [on my YouTube](https://youtu.be/a8Dhj3Zh9vQ). \n2. Remember to add your credentials and configure nodes (covered in the video guide).\n3. If you like this workflow, please subscribe to [my YouTube channel](https://www.youtube.com/@workfloows) and/or [my newsletter](https://workfloows.com/).\n\n**Thank you for your support!**"
      },
      "typeVersion": 1
    },
    {
      "id": "40424340-c0ec-435a-9ce0-0e0dc3b94cfc",
      "name": "스티키 노트4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2160,
        460
      ],
      "parameters": {
        "width": 381.6458068293894,
        "height": 313.7892229150129,
        "content": "### Generate reply\nTransfer email content to OpenAI Assitant and return AI-generated reply.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e7cce507-6658-414d-8cbc-3af847dad124",
      "name": "스티키 노트5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2800,
        460
      ],
      "parameters": {
        "width": 219.88389496558554,
        "height": 314.75072291501283,
        "content": "### Create HTML message\nConvert incoming Markdown from OpenAI Assistant into HTML content."
      },
      "typeVersion": 1
    },
    {
      "id": "2b383967-0a23-46a1-9a19-a9532a3c3425",
      "name": "스티키 노트7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3040,
        460
      ],
      "parameters": {
        "width": 461.3148409669012,
        "height": 314.75072291501283,
        "content": "### Build and encode message\nCreate raw message in RFC standard and encode it into base64 string (please see [Gmail API reference](https://developers.google.com/gmail/api/reference/rest/v1/users.drafts/create) for more details)."
      },
      "typeVersion": 1
    },
    {
      "id": "07685b17-cf22-4adf-a6b7-7acc2d863115",
      "name": "스티키 노트8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3520,
        460
      ],
      "parameters": {
        "width": 219.88389496558554,
        "height": 314.75072291501283,
        "content": "### Insert reply draft\nAdd reply draft from OpenAI Assistant to specific Gmail thread."
      },
      "typeVersion": 1
    },
    {
      "id": "1e8109f8-7dd3-4308-a5e8-32382aa41805",
      "name": "스티키 노트9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3760,
        460
      ],
      "parameters": {
        "width": 219.88389496558554,
        "height": 314.75072291501283,
        "content": "### Remove label\nDelete trigger label from the Gmail thread."
      },
      "typeVersion": 1
    },
    {
      "id": "d488db90-7367-49fa-b366-ccdfc796b5b3",
      "name": "특정 라벨이 있는 스레드 가져오기",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1180,
        580
      ],
      "parameters": {
        "filters": {
          "labelIds": []
        },
        "resource": "thread",
        "returnAll": true
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "uBcIMfsTtKjexw7I",
          "name": "Gmail (workfloowstutorial@gmail.com)"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "9f5262c5-d319-4a9d-af6e-aa42970d1a6f",
      "name": "Ask OpenAI Assistant",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2220,
        580
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "prompt": "define",
        "options": {},
        "resource": "assistant",
        "assistantId": {
          "__rl": true,
          "mode": "list",
          "value": "asst_kmKeAtwF2rv0vgF0ujY4jlp6",
          "cachedResultName": "Customer assistant"
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "jazew1WAaSRrjcHp",
          "name": "OpenAI (workfloows@gmail.com)"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6ffd7d66-40b6-49a4-9e15-9742bda73d2f",
      "name": "스레드 반복 처리",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1440,
        580
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "8afc47c8-075f-4f3d-a89d-fda81fc270fc",
      "name": "스레드 메시지 가져오기",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1700,
        820
      ],
      "parameters": {
        "options": {
          "returnOnlyMessages": true
        },
        "resource": "thread",
        "threadId": "={{ $json.id }}",
        "operation": "get"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "uBcIMfsTtKjexw7I",
          "name": "Gmail (workfloowstutorial@gmail.com)"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "2286bfa7-dcb8-4a61-a71b-ea58e21bf7ab",
      "name": "스레드의 마지막 메시지 반환",
      "type": "n8n-nodes-base.limit",
      "position": [
        1920,
        820
      ],
      "parameters": {
        "keep": "lastItems"
      },
      "typeVersion": 1
    },
    {
      "id": "44c52e61-dd88-4499-85db-69ce4704c2b2",
      "name": "단일 메시지 내용 가져오기",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1700,
        460
      ],
      "parameters": {
        "simple": false,
        "options": {},
        "messageId": "={{ $json.id }}",
        "operation": "get"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "uBcIMfsTtKjexw7I",
          "name": "Gmail (workfloowstutorial@gmail.com)"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "7ca62611-f02e-47bf-b940-3a56ece443b7",
      "name": "스티키 노트10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1640,
        340
      ],
      "parameters": {
        "width": 219.88389496558554,
        "height": 314.75072291501283,
        "content": "### Return message content\nRetrieve content of the last message in the thread."
      },
      "typeVersion": 1
    },
    {
      "id": "165df2a4-3c94-456d-9906-be8020098802",
      "name": "스티키 노트11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1640,
        680
      ],
      "parameters": {
        "width": 470.88389496558545,
        "height": 314.75072291501283,
        "content": "### Get last message from thread\nReturn all messages for a single thread and pass for further processing only the last one."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "connections": {
    "da35eda9-b63e-49f9-8fe8-7517c1445c92": {
      "main": [
        [
          {
            "node": "a99b3164-fe36-4dde-9525-110c1ae08afb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6ffd7d66-40b6-49a4-9e15-9742bda73d2f": {
      "main": [
        [
          {
            "node": "44c52e61-dd88-4499-85db-69ce4704c2b2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "8afc47c8-075f-4f3d-a89d-fda81fc270fc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8afc47c8-075f-4f3d-a89d-fda81fc270fc": {
      "main": [
        [
          {
            "node": "2286bfa7-dcb8-4a61-a71b-ea58e21bf7ab",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9f5262c5-d319-4a9d-af6e-aa42970d1a6f": {
      "main": [
        [
          {
            "node": "ca4a209b-a79d-4911-b69b-1db22808be60",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a99b3164-fe36-4dde-9525-110c1ae08afb": {
      "main": [
        [
          {
            "node": "f0f731bd-7b2f-4c39-bc06-42fd57bc4ae8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "93eb3844-f1fe-4b09-bcae-3e372a19ab6f": {
      "main": [
        [
          {
            "node": "da35eda9-b63e-49f9-8fe8-7517c1445c92",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "65f0508a-ca2e-49ce-b02f-ef6505b5e983": {
      "main": [
        [
          {
            "node": "d488db90-7367-49fa-b366-ccdfc796b5b3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f0f731bd-7b2f-4c39-bc06-42fd57bc4ae8": {
      "main": [
        [
          {
            "node": "c1ce3400-4582-46c7-a85d-8fa9c325ff7b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "44c52e61-dd88-4499-85db-69ce4704c2b2": {
      "main": [
        [
          {
            "node": "9f5262c5-d319-4a9d-af6e-aa42970d1a6f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2286bfa7-dcb8-4a61-a71b-ea58e21bf7ab": {
      "main": [
        [
          {
            "node": "6ffd7d66-40b6-49a4-9e15-9742bda73d2f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d488db90-7367-49fa-b366-ccdfc796b5b3": {
      "main": [
        [
          {
            "node": "6ffd7d66-40b6-49a4-9e15-9742bda73d2f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ca4a209b-a79d-4911-b69b-1db22808be60": {
      "main": [
        [
          {
            "node": "93eb3844-f1fe-4b09-bcae-3e372a19ab6f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

이 워크플로우를 어떻게 사용하나요?

위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.

이 워크플로우는 어떤 시나리오에 적합한가요?

고급 - 티켓 관리, 멀티모달 AI

유료인가요?

이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
고급
노드 수23
카테고리2
노드 유형10
난이도 설명

고급 사용자를 위한 16+개 노드의 복잡한 워크플로우

저자

Water Engineer, learning to integrate AI, ML, DL, NNA into Water Engineering for LMI Countries.

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34