← Files ConductorARCHIVED FILE

skills/conductor/examples/workflows/do-while-loop.json

962 Bytes · Oct 3, 2026 · 06:32 UTC

↓ Download file

{
  "name": "paginated_fetch",
  "description": "Fetch N pages from an endpoint via DO_WHILE",
  "version": 1,
  "schemaVersion": 2,
  "inputParameters": ["endpoint", "count"],
  "tasks": [
    {
      "name": "loop",
      "taskReferenceName": "loop_ref",
      "type": "DO_WHILE",
      "evaluatorType": "graaljs",
      "loopCondition": "(function(){ return $.loop_ref['iteration'] < $.value; })();",
      "loopOver": [
        {
          "name": "do_work",
          "taskReferenceName": "do_work",
          "type": "HTTP",
          "inputParameters": {
            "http_request": {
              "uri": "${workflow.input.endpoint}?page=${loop_ref.output.iteration}",
              "method": "GET"
            }
          }
        }
      ],
      "inputParameters": {
        "value": "${workflow.input.count}",
        "loop_ref": "${loop_ref.output}"
      }
    }
  ],
  "outputParameters": {
    "iterations": "${loop_ref.output.iteration}"
  }
}

SHA-256: c924dfdea15a5e70c06cdccc82dda07a05fc72063144a8ddebfc1317106b4df8