AutomationFlowsMarketing & Ads › Lead Intake -> Gpt -> Zammad

Lead Intake -> Gpt -> Zammad

Lead Intake -> GPT -> Zammad. Uses httpRequest. Webhook trigger; 5 nodes.

Webhook trigger★★★★☆ complexity5 nodesHTTP Request
Marketing & Ads Trigger: Webhook Nodes: 5 Complexity: ★★★★☆ 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": "Lead Intake -> GPT -> Zammad",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "lead-intake",
        "responseMode": "responseNode",
        "options": {
          "binaryData": true
        }
      },
      "id": "1",
      "name": "Webhook Lead Intake",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        240,
        280
      ]
    },
    {
      "parameters": {
        "jsCode": "const body = $json.body || {};\nconst pick = (v) => (typeof v === 'string' ? v.trim() : '');\n\nconst lead = {\n  name: pick(body.name),\n  company: pick(body.company),\n  phone: pick(body.phone),\n  email: pick(body.email),\n  position: pick(body.position),\n  source: pick(body.source || '\u0412\u044b\u0441\u0442\u0430\u0432\u043a\u0430'),\n  comment: pick(body.comment),\n};\n\nif (!lead.name || !lead.company || !lead.phone || !lead.email || !lead.position || !lead.source || !lead.comment) {\n  throw new Error('Missing required lead fields');\n}\n\nreturn [{ json: { lead } }];"
      },
      "id": "2",
      "name": "Validate Required Fields",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        500,
        280
      ]
    },
    {
      "parameters": {
        "url": "={{$env.ZAMMAD_BASE_URL}}/api/v1/tickets",
        "method": "POST",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Token token={{$env.ZAMMAD_API_TOKEN}}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"title\": \"Lead: \" + $json.lead.company + \" / \" + $json.lead.name,\n  \"group\": $env.ZAMMAD_GROUP || \"managers\",\n  \"customer\": $json.lead.email || $env.ZAMMAD_FALLBACK_CUSTOMER_EMAIL,\n  \"article\": {\n    \"subject\": \"\u041d\u043e\u0432\u044b\u0439 \u043b\u0438\u0434 \u0441 \u0432\u044b\u0441\u0442\u0430\u0432\u043a\u0438\",\n    \"body\": \"\u0418\u043c\u044f: \" + $json.lead.name + \\\"\\n\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f: \\\" + $json.lead.company + \\\"\\n\u0422\u0435\u043b\u0435\u0444\u043e\u043d: \\\" + $json.lead.phone + \\\"\\nEmail: \\\" + $json.lead.email + \\\"\\n\u0414\u043e\u043b\u0436\u043d\u043e\u0441\u0442\u044c: \\\" + $json.lead.position + \\\"\\n\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: \\\" + $json.lead.source + \\\"\\n\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439: \\\" + $json.lead.comment,\n    \"type\": \"note\",\n    \"internal\": false\n  }\n}"
      },
      "id": "3",
      "name": "Create Zammad Ticket",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        760,
        280
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={\"ok\": true, \"ticket\": $json.id || null}"
      },
      "id": "4",
      "name": "Respond Success",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        1020,
        280
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseCode": 400,
        "responseBody": "={\"ok\": false, \"error\": \"Invalid payload or upstream failure\"}"
      },
      "id": "5",
      "name": "Respond Error",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        760,
        420
      ]
    }
  ],
  "connections": {
    "Webhook Lead Intake": {
      "main": [
        [
          {
            "node": "Validate Required Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Required Fields": {
      "main": [
        [
          {
            "node": "Create Zammad Ticket",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Zammad Ticket": {
      "main": [
        [
          {
            "node": "Respond Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "active": true,
  "versionId": "1"
}
Pro

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

About this workflow

Lead Intake -> GPT -> Zammad. Uses httpRequest. Webhook trigger; 5 nodes.

Source: https://github.com/0079925/AI_cards/blob/eb44a4e6df9cd3a79c1d03ebdc8e10dd89e4edf4/workflows/lead_capture.json — original creator credit. Request a take-down →

More Marketing & Ads workflows → · Browse all categories →

Related workflows

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

Marketing & Ads

Ad agencies needing automated lead capture. Sales teams fighting fraud and scoring leads. B2B SaaS companies nurturing prospects. Marketing pros boosting sales pipelines. Captures leads via Webhook fr

HTTP Request, Google Sheets, Slack +2
Marketing & Ads

Store leads in a SQL Server database via REST API with automatic scoring and Slack notifications.

HTTP Request, Slack, Error Trigger
Marketing & Ads

This workflow captures real estate leads via a webhook, uses an OpenAI-compatible Chat Completions API call to qualify and draft a reply, then sends emails through Gmail and logs the lead to Google Sh

HTTP Request, Gmail, Google Sheets
Marketing & Ads

Instantly reach new leads on WhatsApp when they submit a form (Typeform, JotForm, Google Forms, or any webhook-enabled form) using MoltFlow (https://molt.waiflow.app). Leads are also logged to Google

HTTP Request, Google Sheets
Marketing & Ads

MELANO INC - Lead Capture. Uses supabase, whatsApp, httpRequest. Webhook trigger; 7 nodes.

Supabase, WhatsApp, HTTP Request