{
  "name": "Zero-Fluff Ops #007 — BYO-Key ClickUp AI Triage Gateway (Make.com)",
  "flow": [
    {
      "id": 1,
      "module": "gateway:CustomWebHook",
      "version": 1,
      "parameters": {},
      "mapper": {},
      "metadata": {
        "designer": { "x": 0, "y": 0 },
        "notes": "Step 1: Receive ClickUp taskCreated webhook payload (task_id, name, description, parent, creator_is_bot)."
      }
    },
    {
      "id": 2,
      "module": "http:ActionSendData",
      "version": 3,
      "filter": {
        "name": "Early Zero-Cost Noise Filter",
        "conditions": [
          [
            {
              "a": "{{length(1.name)}}",
              "b": "6",
              "o": "number:greater"
            },
            {
              "a": "{{1.parent}}",
              "o": "exist:not"
            },
            {
              "a": "{{1.creator_is_bot}}",
              "b": "true",
              "o": "text:notequal"
            }
          ]
        ]
      },
      "mapper": {
        "url": "https://api.openai.com/v1/chat/completions",
        "method": "post",
        "headers": [
          { "name": "Authorization", "value": "Bearer YOUR_OPENAI_API_KEY" },
          { "name": "Content-Type", "value": "application/json" }
        ],
        "bodyType": "raw",
        "contentType": "application/json",
        "data": "{\"model\":\"gpt-4o-mini\",\"response_format\":{\"type\":\"json_object\"},\"messages\":[{\"role\":\"system\",\"content\":\"Return JSON only: {priority: urgent|high|normal, owner_team: ops|eng|support, summary_one_line: string}\"},{\"role\":\"user\",\"content\":\"Title: {{1.name}} | Description: {{1.description}}\"}]}",
        "parseResponse": true
      },
      "metadata": {
        "designer": { "x": 320, "y": 0 },
        "notes": "Step 2-3: Filter drops subtasks/bots ($0) and classifies task with BYO API key instead of ClickUp Super Credits."
      }
    },
    {
      "id": 3,
      "module": "json:ParseJSON",
      "version": 1,
      "mapper": {
        "json": "{{2.data.choices[1].message.content}}"
      },
      "metadata": {
        "designer": { "x": 620, "y": 0 },
        "notes": "Parse structured JSON triage output."
      }
    },
    {
      "id": 4,
      "module": "clickup:editTask",
      "version": 1,
      "mapper": {
        "taskId": "{{1.task_id}}",
        "priority": "{{3.priority}}",
        "tags": ["{{3.owner_team}}", "ai-triaged"]
      },
      "metadata": {
        "designer": { "x": 920, "y": 0 },
        "notes": "Step 4: Update ClickUp task via standard API (0 Super Credits consumed)."
      }
    },
    {
      "id": 5,
      "module": "builtin:BasicRouter",
      "version": 1,
      "routes": [
        {
          "flow": [
            {
              "id": 6,
              "module": "slack:CreateMessage",
              "version": 1,
              "filter": {
                "name": "Urgent Escalation Only",
                "conditions": [
                  [
                    {
                      "a": "{{3.priority}}",
                      "b": "urgent",
                      "o": "text:equal"
                    }
                  ]
                ]
              },
              "mapper": {
                "channel": "YOUR_OPS_ALERTS_CHANNEL_ID",
                "text": "Urgent ClickUp Task [{{3.owner_team}}]: {{1.name}} — {{3.summary_one_line}}"
              },
              "metadata": {
                "designer": { "x": 1240, "y": -100 },
                "notes": "Notify Slack only when priority is urgent."
              }
            }
          ]
        },
        {
          "flow": [
            {
              "id": 7,
              "module": "gateway:WebhookRespond",
              "version": 1,
              "mapper": {
                "status": 200,
                "body": "{\"ok\": true, \"task_id\": \"{{1.task_id}}\", \"priority\": \"{{3.priority}}\", \"tokens\": {{2.data.usage.total_tokens}}}"
              },
              "metadata": {
                "designer": { "x": 1240, "y": 100 },
                "notes": "Step 5: Return audit trace with token usage."
              }
            }
          ]
        }
      ],
      "metadata": {
        "designer": { "x": 1080, "y": 0 },
        "notes": "Routers cost 0 credits on Make.com."
      }
    }
  ],
  "metadata": {
    "instant": true,
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true
    },
    "author": "Zero-Fluff Ops (zerofluffops.substack.com)"
  }
}
