{
  "name": "Nodbot - ClickUp task automation with routing",
  "nodes": [
    {
      "parameters": {
        "path": "integration-clickup-n8n-task-automation",
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "id": "8d1872d6-c3ea-43a1-be43-6e0de908e2ba",
      "name": "Webhook task input",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        260
      ]
    },
    {
      "parameters": {
        "jsCode": "const src = $json.body ?? $json;\nconst eventType = String(src.event_type ?? '').trim().toLowerCase();\nconst entityId = String(src.entity_id ?? '').trim();\nif (!eventType || !entityId) throw new Error('event_type and entity_id are required');\nconst listMap = { new_bug_report: 'CLICKUP_BUGS_LIST_ID', content_request: 'CLICKUP_CONTENT_LIST_ID', sales_followup: 'CLICKUP_SALES_LIST_ID' };\nconst listId = listMap[eventType] ?? 'CLICKUP_INBOX_LIST_ID';\nconst priorityMap = { low: 4, normal: 3, high: 2, urgent: 1 };\nconst priority = priorityMap[String(src.priority ?? 'normal').toLowerCase()] ?? 3;\nconst dueAt = src.due_at ? Date.parse(src.due_at) : null;\nif (src.due_at && Number.isNaN(dueAt)) throw new Error(`Invalid ClickUp due_at: ${src.due_at}`);\nconst dedupeKey = `clickup:${eventType}:${entityId}`;\nreturn [{ json: { dedupe_key: dedupeKey, list_id: listId, task: {\n  name: String(src.title ?? 'New task').trim().slice(0, 180),\n  description: `${src.description ?? ''}\\n\\nSource: ${src.source ?? 'external'}\\nEntity: ${entityId}\\nURL: ${src.customer_url ?? ''}`,\n  priority,\n  due_date: dueAt || undefined,\n  tags: Array.isArray(src.labels) ? src.labels.slice(0, 10) : [],\n  custom_fields: [{ id: 'external_id_field', value: dedupeKey }, { id: 'source_field', value: String(src.source ?? 'external') }]\n}} }];"
      },
      "id": "4d3a208e-a564-4505-a6a9-257772f99bb6",
      "name": "Route and normalize ClickUp task",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        280,
        260
      ]
    },
    {
      "parameters": {},
      "id": "f1a68233-e2e2-4f98-850c-f4ce9fdf0824",
      "name": "Check idempotency",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        560,
        260
      ]
    },
    {
      "parameters": {},
      "id": "d3be2150-8e42-4eee-ac15-53c7848472ab",
      "name": "Create or update ClickUp task",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        840,
        260
      ]
    },
    {
      "parameters": {},
      "id": "58a1a7fb-6c4c-4bf5-87ba-0e0df14fad9f",
      "name": "Notify owner",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        1120,
        260
      ]
    },
    {
      "parameters": {},
      "id": "abd8314b-66c8-471f-a34c-237543f653b5",
      "name": "Respond",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 2,
      "position": [
        1400,
        260
      ]
    }
  ],
  "connections": {
    "Webhook task input": {
      "main": [
        [
          {
            "node": "Route and normalize ClickUp task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route and normalize ClickUp task": {
      "main": [
        [
          {
            "node": "Check idempotency",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check idempotency": {
      "main": [
        [
          {
            "node": "Create or update ClickUp task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create or update ClickUp task": {
      "main": [
        [
          {
            "node": "Notify owner",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify owner": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [
    "nodbot",
    "integration",
    "production"
  ],
  "triggerCount": 1,
  "updatedAt": "2026-05-30T00:00:00.000Z",
  "versionId": "ccf9cae7-1a1d-478f-8a3b-11ec03feb72f",
  "meta": {
    "templateCredsSetupCompleted": false
  }
}