code: def _do_scatter_var(v, parallel):
      
      # For batches, scatter records only at the top level (double nested)
      if parallel.startswith("batch") and workflow.is_cwl_record(v):
          return (tz.get_in(["type", "type"], v) == "array" and
                  tz.get_in(["type", "type", "type"], v) == "array")
      # Otherwise, scatter arrays
      else:
          return (tz.get_in(["type", "type"], v) == "array")
docs: Logic for scattering a variable.