AutomationFlowsAI & RAG › Email Task - Simple

Email Task - Simple

Email Task - Simple. Uses openAi. Webhook trigger; 4 nodes.

Webhook trigger★★★★☆ complexityAI-powered4 nodesOpenAI
AI & RAG Trigger: Webhook Nodes: 4 Complexity: ★★★★☆ AI nodes: yes Added:

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": "Email Task - Simple",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "email-task",
        "responseMode": "responseNode"
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        240,
        300
      ],
      "id": "webhook-node"
    },
    {
      "parameters": {
        "model": "gpt-3.5-turbo",
        "messages": {
          "messageType": "multipleMessages",
          "messages": [
            {
              "role": "system",
              "message": "You are a professional email assistant. Generate emails in JSON format with 'subject' and 'body' fields only. Example: {\"subject\": \"Meeting Request\", \"body\": \"Dear Recipient,\\n\\nContent...\\n\\nBest regards\"}"
            },
            {
              "role": "user",
              "message": "=Create an email for {{ $json.recipientEmail }} about: {{ $json.content }}. Tone: {{ $json.tone || 'professional' }}. From: {{ $json.senderName || 'User' }}. Return JSON with subject and body fields only."
            }
          ]
        },
        "options": {
          "temperature": 0.7,
          "maxTokens": 1000
        }
      },
      "name": "OpenAI",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [
        460,
        300
      ],
      "id": "openai-node"
    },
    {
      "parameters": {
        "jsCode": "// Process OpenAI response\nconst webhookData = $('Webhook').first().json;\nconst aiResponse = $input.first().json;\n\nlet emailData;\ntry {\n  const content = aiResponse.choices[0].message.content.trim();\n  \n  // Try to parse JSON\n  try {\n    emailData = JSON.parse(content);\n  } catch {\n    // Fallback parsing\n    const lines = content.split('\\n').filter(l => l.trim());\n    const subject = lines[0]?.replace(/.*subject[:\\s]*/i, '') || 'Email';\n    const body = lines.slice(1).join('\\n') || webhookData.content;\n    emailData = { subject, body };\n  }\n  \n  return {\n    success: true,\n    recipientEmail: webhookData.recipientEmail,\n    subject: emailData.subject.replace(/[\"']/g, ''),\n    body: emailData.body.replace(/\\\\n/g, '\\n'),\n    senderName: webhookData.senderName || 'User',\n    timestamp: new Date().toISOString(),\n    executionId: 'email_' + Date.now()\n  };\n  \n} catch (error) {\n  return {\n    success: false,\n    error: 'Failed to process: ' + error.message,\n    recipientEmail: webhookData.recipientEmail,\n    timestamp: new Date().toISOString()\n  };\n}"
      },
      "name": "Process Response",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        680,
        300
      ],
      "id": "process-node"
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={\n  \"success\": {{ $json.success }},\n  \"data\": {\n    \"id\": \"{{ $json.executionId }}\",\n    \"recipient\": \"{{ $json.recipientEmail }}\",\n    \"subject\": \"{{ $json.subject }}\",\n    \"body\": \"{{ $json.body }}\",\n    \"timestamp\": \"{{ $json.timestamp }}\",\n    \"message\": \"Email content generated successfully\"\n  }\n}"
      },
      "name": "Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        900,
        300
      ],
      "id": "response-node"
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI": {
      "main": [
        [
          {
            "node": "Process Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Response": {
      "main": [
        [
          {
            "node": "Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "timezone": "Asia/Kolkata"
  },
  "versionId": "1",
  "id": "email-simple",
  "tags": [
    "email",
    "ai",
    "simple"
  ]
}
Pro

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

About this workflow

Email Task - Simple. Uses openAi. Webhook trigger; 4 nodes.

Source: https://github.com/masteranany23/TaskIt/blob/a25cceccbf0ce9b0b9d1320351c46493a60f25b9/n8n-workflows/email-simple.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

This workflow captures new leads via webhook, enriches and scores them with Apollo and Google Gemini, logs everything in Google Sheets, and automates outreach, reply handling, follow-ups, meeting prep

HTTP Request, Google Gemini, Google Sheets +3
AI & RAG

This powerful n8n automation workflow is designed to execute advanced B2B lead enrichment and hyper-personalization for cold email outreach. By orchestrating a complex chain of data scraping, AI analy

OpenAI, HTTP Request, Airtable
AI & RAG

Propulsar — Content Engine v3. Uses openAi, httpRequest, googleSheets. Webhook trigger; 73 nodes.

OpenAI, HTTP Request, Google Sheets
AI & RAG

Eu Clara – Funil Kiwify Completo. Uses postgres, openAi, httpRequest, gmail. Webhook trigger; 70 nodes.

Postgres, OpenAI, HTTP Request +1
AI & RAG

Postagem Redes — Portal: Ações. Uses openAi, googleGemini, ollama, httpRequest. Webhook trigger; 58 nodes.

OpenAI, Google Gemini, Ollama +4