{
  "schemaVersion": "flowdrome.workflow.v1",
  "id": "",
  "name": "Nightly statements — loop the batch",
  "version": "0",
  "status": "draft",
  "nodes": [
    {
      "id": "seed",
      "type": "input.inject",
      "label": "Statement batch",
      "category": "trigger",
      "config": {
        "contentType": "application/json",
        "payload": [
          {
            "customer": "Acme",
            "balance": 1200
          },
          {
            "customer": "Globex",
            "balance": 89
          },
          {
            "customer": "Initech",
            "balance": 432
          }
        ]
      },
      "position": {
        "x": 60,
        "y": 160
      }
    },
    {
      "id": "loop",
      "type": "logic.loop",
      "label": "Per statement",
      "category": "flow",
      "config": {
        "batchSize": 1,
        "concurrency": 1
      },
      "position": {
        "x": 380,
        "y": 60
      },
      "width": 460,
      "height": 300
    },
    {
      "id": "render",
      "type": "utility.javascript",
      "label": "Render statement",
      "category": "script",
      "config": {
        "code": "return { line: input.customer + ': $' + input.balance.toFixed(2) };",
        "outputs": [
          "output"
        ]
      },
      "position": {
        "x": 470,
        "y": 150
      },
      "parentLoop": "loop"
    },
    {
      "id": "out",
      "type": "utility.console",
      "label": "Statement run",
      "category": "utility",
      "config": {
        "message": "Statements ready: {{ $json }}"
      },
      "position": {
        "x": 950,
        "y": 160
      }
    }
  ],
  "edges": [
    {
      "id": "e0",
      "sourceNodeId": "seed",
      "sourcePort": "output",
      "targetNodeId": "loop",
      "targetPort": "input"
    },
    {
      "id": "e1",
      "sourceNodeId": "loop",
      "sourcePort": "done",
      "targetNodeId": "out",
      "targetPort": "input"
    }
  ],
  "triggers": [
    {
      "id": "t0",
      "nodeId": "seed"
    }
  ],
  "meta": {
    "snippets": [],
    "source": "template-gallery",
    "description": "Three customer statements processed one at a time through a Loop frame — each pass renders one statement, and the DONE port emits the collected results."
  }
}