{
  "name": "Nodbot - Trello card sync with dedupe",
  "nodes": [
    {
      "parameters": {
        "path": "integration-trello-n8n-card-sync",
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "id": "62ee0777-590e-4373-9b76-37a671ce4993",
      "name": "Webhook Trello event",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        260
      ]
    },
    {
      "parameters": {
        "jsCode": "const src = $json.body ?? $json;\nconst source = String(src.source ?? 'external').trim().toLowerCase();\nconst entityId = String(src.entity_id ?? src.id ?? '').trim();\nif (!entityId) throw new Error('No entity_id for Trello card sync');\nconst title = String(src.title ?? '').trim();\nif (title.length < 5) throw new Error('Trello card title is too short');\nconst due = String(src.due_date ?? '').trim();\nif (due && Number.isNaN(Date.parse(due))) throw new Error(`Invalid Trello due date: ${due}`);\nconst labels = Array.isArray(src.labels) ? src.labels.slice(0, 8).map(String) : [];\nconst checklist = Array.isArray(src.checklist) ? src.checklist.map(String).filter(Boolean) : [];\nconst externalId = `trello-sync:${source}:${entityId}`;\nreturn [{ json: {\n  external_id: externalId,\n  trello: {\n    idList: src.list_id,\n    name: title.slice(0, 160),\n    desc: `[external_id:${externalId}]\n${String(src.description ?? '').trim()}\n\nSource: ${src.source_url ?? ''}`,\n    due: due || null,\n    labels,\n    checklist\n  },\n  search_query: externalId,\n  source_url: src.source_url ?? '',\n  received_at: new Date().toISOString()\n}}];"
      },
      "id": "5f28f815-b8cb-4e87-a42b-889bacb3496f",
      "name": "Normalize Trello fields",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        280,
        260
      ]
    },
    {
      "parameters": {},
      "id": "e3344e31-f6a9-41e9-9b6f-3b9ae42dc999",
      "name": "Find existing card",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        560,
        260
      ]
    },
    {
      "parameters": {},
      "id": "d2607b0a-3eab-4fd5-8f49-b664180c06af",
      "name": "Create or update card",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        840,
        260
      ]
    },
    {
      "parameters": {},
      "id": "d488f93f-202e-4e03-bc52-0911938e3be3",
      "name": "Add checklist/comment",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        1120,
        260
      ]
    },
    {
      "parameters": {},
      "id": "1691f633-0694-4426-ac14-e96533bb42be",
      "name": "Respond",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 2,
      "position": [
        1400,
        260
      ]
    }
  ],
  "connections": {
    "Webhook Trello event": {
      "main": [
        [
          {
            "node": "Normalize Trello fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Trello fields": {
      "main": [
        [
          {
            "node": "Find existing card",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find existing card": {
      "main": [
        [
          {
            "node": "Create or update card",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create or update card": {
      "main": [
        [
          {
            "node": "Add checklist/comment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add checklist/comment": {
      "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": "44ce709b-a055-491c-9b3a-595f536ab643",
  "meta": {
    "templateCredsSetupCompleted": false
  }
}