{
  "source": "iterator.js",
  "method": "iterate",
  "input-schema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "collection": {
        "description": "A collection to iterate on. For each entry in the collection, the given iteratee (sub flow) is invoked.",
        "type": "any",
        "required": true
      },
      "key": {
        "type": "string",
        "description": "Iteration variable name. Useful for mapping input data for iteratee flow file.",
        "default": "item",
        "format": "plain",
        "required": true
      },
      "iteratee":  {
          "type": "flow",
          "description": "A flow file that will be executed for each item in the collection and the output of each execution is appended to the output array. Empty values are ignored if excludeEmpty flag is checked.",
          "required": true,
          "inputtitle": "input",
          "inputkey": "__input"
      },
      "options": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
              "parallel": {
                 "title" :"parallel?",
                 "type": "boolean",
                 "description": "When set, invokes the flow in parallel for each item.",
                 "format" : "plain"
              },
              "limit": {
                 "title" :"parallel limit",
                 "type": "integer",
                 "description": "Max number of parallel instances to be invoked."
              },
              "excludeEmpty": {
                 "title" :"exclude empty results?",
                 "type": "boolean",
                 "description": "When set will exclude empty results from the output. Useful for skipping values from output array.",
                 "format" : "plain"
              }
          }
      }
    }
  },
  "output-schema": {
    "type": "array",
    "description": "Array combining all the output after applying the iterator sub flow to each element.",
    "items": {
      "description": "Choose the iterator sub flow to reflect it's output schema here.",
      "type": "any"
    },
    "dynamic": {
      "target": "iteratee"
    }
  },
  "meta": {
    "name": "iterate",
    "sort_index": 5,
    "description": "Iterate through a collection, invoking the given subflow for each item. The output of this step will be a collection of outputs from all the subflows.",
    "icon": {
      "type": "fa",
      "name": "repeat",
      "color":"#747CA3"
    }
  }
}
