title: QGIS 3 python loop through layers and run algorithm
body: <p>I'm attempting to loop through layers and run a processing algorithm on each layer but get an error with the input:</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>feedback = QgsProcessingFeedback()
  
  # Get current layers
  layers = QgsProject.instance().mapLayers().values()
  
  # Loop through layer and run algorithm
  for layer in layers:
      processing.run("qgis:pointstopath", {'INPUT': layer, 'ORDER_FIELD': 'name', 'GROUP_FIELD': 'name','OUTPUT': layer+'.gpkg'},feedback)
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code>Traceback (most recent call last):
  File "C:\OSGEO4~1\apps\Python37\lib\code.py", line 90, in runcode
  exec(code, self.locals)
  File "&lt;input&gt;", line 2, in &lt;module&gt;
  File "C:/OSGEO4~1/apps/qgis-rel- 
  dev/./python/plugins\processing\tools\general.py", line 105, in run
  return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback,
  context)
  File "C:/OSGEO4~1/apps/qgis-rel- 
  dev/./python/plugins\processing\core\Processing.py", line 183, in 
  runAlgorithm
  raise QgsProcessingException(msg)
  _core.QgsProcessingException: There were errors executing the algorithm.
  </code></pre>
  
  <p>How do you correctly parse the input layers from the map to the algorithm?</p>