AutomationFlowsAI & RAG › Gmail受信メール処理ワークフロー(step2)

Gmail受信メール処理ワークフロー(step2)

Gmail受信メール処理ワークフロー(Step2). Uses gmailTrigger, openAi. Event-driven trigger; 4 nodes.

Event trigger★★☆☆☆ complexityAI-powered4 nodesGmail TriggerOpenAI
AI & RAG Trigger: Event Nodes: 4 Complexity: ★★☆☆☆ AI nodes: yes Added:

This workflow follows the Gmail Trigger → OpenAI recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "Gmail\u53d7\u4fe1\u30e1\u30fc\u30eb\u51e6\u7406\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\uff08Step2\uff09",
  "nodes": [
    {
      "parameters": {
        "authentication": "oAuth2",
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "simple": false,
        "filters": {}
      },
      "id": "d4f2c0a1-8b3e-4c5a-9d7f-1e2a3b4c5d6e",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "typeVersion": 1.2,
      "position": [
        240,
        400
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "sender",
              "value": "={{ $json.payload.headers.find(h => h.name === 'From').value }}"
            },
            {
              "name": "subject",
              "value": "={{ $json.payload.headers.find(h => h.name === 'Subject').value }}"
            },
            {
              "name": "body",
              "value": "={{ $json.snippet }}"
            },
            {
              "name": "received_time",
              "value": "={{ new Date($json.internalDate * 1).toISOString() }}"
            },
            {
              "name": "sender_clean",
              "value": "={{ $json.payload.headers.find(h => h.name === 'From').value.split('<')[0].trim() }}"
            }
          ]
        },
        "options": {}
      },
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "\u30e1\u30fc\u30eb\u60c5\u5831\u62bd\u51fa",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        460,
        400
      ]
    },
    {
      "parameters": {
        "resource": "text",
        "operation": "complete",
        "prompt": "\u4ee5\u4e0b\u306e\u30e1\u30fc\u30eb\u5185\u5bb9\u3092\u8981\u7d04\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u5f62\u5f0f\u3067\u65e5\u672c\u8a9e\u3067\u8fd4\u3057\u3066\u304f\u3060\u3055\u3044\uff1a\n\n\u3010\u8981\u7d04\u3011\n\u30fb[\u7b87\u6761\u66f8\u304d\u3067\u8981\u7d04]\n\n\u3010\u9001\u4fe1\u8005\u3011{{ $json.sender_clean }}\n\u3010\u4ef6\u540d\u3011{{ $json.subject }}\n\u3010\u65e5\u6642\u3011{{ $json.received_time }}\n\u3010\u30b9\u30c6\u30fc\u30bf\u30b9\u3011\u672a\u5bfe\u5fdc\n\u3010\u6b21\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u3011\n\u30fb[\u5fc5\u8981\u306a\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u3042\u308c\u3070\u8a18\u8f09\u3001\u306a\u3051\u308c\u3070\u300c\u306a\u3057\u300d]\n\u3010\u7de0\u5207/\u65e5\u4ed8\u3011\n\u30fb[\u671f\u9650\u3084\u91cd\u8981\u306a\u65e5\u4ed8\u304c\u3042\u308c\u3070\u8a18\u8f09\u3001\u306a\u3051\u308c\u3070\u300c\u306a\u3057\u300d]\n\n\u3010\u30e1\u30fc\u30eb\u672c\u6587\u3011\n{{ $json.body }}",
        "maxTokens": 500,
        "options": {}
      },
      "id": "e1f2a3b4-c5d6-7890-abcd-ef1234567890",
      "name": "OpenAI\u8981\u7d04\u51e6\u7406",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1.1,
      "position": [
        680,
        400
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "summary",
              "value": "={{ $json.data.choices[0].text }}"
            },
            {
              "name": "sender",
              "value": "={{ $('\u30e1\u30fc\u30eb\u60c5\u5831\u62bd\u51fa').item.json.sender }}"
            },
            {
              "name": "sender_clean",
              "value": "={{ $('\u30e1\u30fc\u30eb\u60c5\u5831\u62bd\u51fa').item.json.sender_clean }}"
            },
            {
              "name": "subject",
              "value": "={{ $('\u30e1\u30fc\u30eb\u60c5\u5831\u62bd\u51fa').item.json.subject }}"
            },
            {
              "name": "received_time",
              "value": "={{ $('\u30e1\u30fc\u30eb\u60c5\u5831\u62bd\u51fa').item.json.received_time }}"
            },
            {
              "name": "body",
              "value": "={{ $('\u30e1\u30fc\u30eb\u60c5\u5831\u62bd\u51fa').item.json.body }}"
            }
          ]
        },
        "options": {}
      },
      "id": "f2a3b4c5-d6e7-8901-bcde-f23456789012",
      "name": "\u8981\u7d04\u7d50\u679c\u7d71\u5408",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        900,
        400
      ]
    }
  ],
  "connections": {
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "\u30e1\u30fc\u30eb\u60c5\u5831\u62bd\u51fa",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u30e1\u30fc\u30eb\u60c5\u5831\u62bd\u51fa": {
      "main": [
        [
          {
            "node": "OpenAI\u8981\u7d04\u51e6\u7406",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI\u8981\u7d04\u51e6\u7406": {
      "main": [
        [
          {
            "node": "\u8981\u7d04\u7d50\u679c\u7d71\u5408",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [
    {
      "createdAt": "2024-09-29T08:30:00.000Z",
      "updatedAt": "2024-09-29T08:30:00.000Z",
      "id": "gmail-automation",
      "name": "Gmail\u81ea\u52d5\u5316"
    }
  ],
  "triggerCount": 1,
  "updatedAt": "2024-09-29T08:30:00.000Z",
  "versionId": "1"
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Gmail受信メール処理ワークフロー(Step2). Uses gmailTrigger, openAi. Event-driven trigger; 4 nodes.

Source: https://github.com/omksds/sandbox/blob/0fd8c76d36d3411b3d119fba17bd68dde0abe9a4/20250929_mail-to-dashboard/gmail_workflow_step2.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

An AI inbox labelling manager that has reasoning attached to the ChatGPT inbox manager within n8n. Super simple yet highly effective automation.

Gmail, Gmail Trigger, Tool Think +1
AI & RAG

gmailAutoResponse. Uses gmailTrigger, openAi, gmail. Event-driven trigger; 3 nodes.

Gmail Trigger, OpenAI, Gmail
AI & RAG

Santander Email to Supabase. Uses gmailTrigger, openAi, supabase. Event-driven trigger; 3 nodes.

Gmail Trigger, OpenAI, Supabase
AI & RAG

Diário automático. Uses openAi, notion, gmailTrigger. Event-driven trigger; 3 nodes.

OpenAI, Notion, Gmail Trigger
AI & RAG

Analyze incoming support requests, classify intent and priority with AI, create Jira tickets, assign the correct team, send Slack notifications, and track SLA deadlines. Supports Gmail, WhatsApp, form

Gmail Trigger, HTTP Request, Form Trigger +4