{
  "schemaVersion": "flowdrome.workflow.v1",
  "id": "",
  "name": "Image farm — thread pool burst",
  "version": "0",
  "status": "draft",
  "nodes": [
    {
      "id": "seed",
      "type": "input.inject",
      "label": "Resize jobs",
      "category": "trigger",
      "config": {
        "contentType": "application/json",
        "payload": [
          {
            "image": "hero.png"
          },
          {
            "image": "banner.png"
          },
          {
            "image": "logo.png"
          }
        ]
      },
      "position": {
        "x": 60,
        "y": 180
      }
    },
    {
      "id": "pool",
      "type": "logic.thread",
      "label": "Resize pool",
      "category": "flow",
      "config": {
        "inputQueue": "nd-pool-mrsqq3k9-in",
        "outputQueue": "nd-pool-mrsqq3k9-out",
        "errorQueue": "",
        "broker": "",
        "token": "",
        "initialThreads": 2,
        "maxThreads": 4,
        "maxItems": 0,
        "maxDurationMs": 0,
        "idleGraceMs": 0
      },
      "position": {
        "x": 380,
        "y": 60
      },
      "width": 480,
      "height": 320
    },
    {
      "id": "resize",
      "type": "utility.javascript",
      "label": "Resize",
      "category": "script",
      "config": {
        "code": "return { image: input.image, resized: true, by: 'thread' };",
        "outputs": [
          "output"
        ]
      },
      "position": {
        "x": 480,
        "y": 170
      },
      "parentThread": "pool"
    },
    {
      "id": "drain",
      "type": "utility.mq",
      "label": "Drain results",
      "category": "queue",
      "config": {
        "provider": "flowdrome",
        "credentialId": "",
        "operation": "consume",
        "queue": "nd-pool-mrsqq3k9-out",
        "messageField": "",
        "maxMessages": 10,
        "timeoutMs": 30000,
        "broker": "",
        "token": "",
        "deleteOnRead": true,
        "host": "localhost",
        "port": 6379,
        "password": "",
        "db": 0,
        "tls": false,
        "rejectUnauthorized": false
      },
      "position": {
        "x": 960,
        "y": 180
      }
    },
    {
      "id": "out",
      "type": "utility.console",
      "label": "Farm output",
      "category": "utility",
      "config": {
        "message": "Resized: {{ $json.count }} images — {{ $json.messages }}"
      },
      "position": {
        "x": 1280,
        "y": 180
      }
    }
  ],
  "edges": [
    {
      "id": "e0",
      "sourceNodeId": "seed",
      "sourcePort": "output",
      "targetNodeId": "pool",
      "targetPort": "input"
    },
    {
      "id": "e1",
      "sourceNodeId": "pool",
      "sourcePort": "message",
      "targetNodeId": "resize",
      "targetPort": "input"
    },
    {
      "id": "e2",
      "sourceNodeId": "resize",
      "sourcePort": "output",
      "targetNodeId": "pool",
      "targetPort": "result"
    },
    {
      "id": "e3",
      "sourceNodeId": "pool",
      "sourcePort": "done",
      "targetNodeId": "drain",
      "targetPort": "input"
    },
    {
      "id": "e4",
      "sourceNodeId": "drain",
      "sourcePort": "output",
      "targetNodeId": "out",
      "targetPort": "input"
    }
  ],
  "triggers": [
    {
      "id": "t0",
      "nodeId": "seed"
    }
  ],
  "meta": {
    "snippets": [],
    "source": "template-gallery",
    "description": "A burst of resize jobs lands on the input queue; the Thread Pool elastically works them (2–4 threads) and publishes results to the output queue, which the consumer drains — watch per-thread activity in the Console."
  }
}