Image farm — thread pool burst

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.

What’s inside

5 nodes — every type links to its full reference page.

StepNodeType
Resize jobs Inject input.inject
Resize pool Thread Pool logic.thread
Resize JavaScript utility.javascript
Drain results Message Queue utility.mq
Farm output Console utility.console

Import it

  1. Studio → Import — paste the JSON below (or the URL /docs/templates/image-farm-thread-pool-burst.json).
  2. Or ask the AI Copilot with the JSON pasted after the phrase:
    import this workflow json into a new workflow named "Image farm — thread pool burst"
  3. Any credentials the nodes need are ${credential.…} references — add them once in Admin → Credentials and the template picks them up. Nothing secret ships in a template.
The workflow document (flowdrome.workflow.v1, 5 node types)
{
  "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."
  }
}

Generated from the verified demo corpus — this exact document seeds and runs on a fresh Flowdrome. Raw JSON: image-farm-thread-pool-burst.json.