I created a processing script in QGIS 2.18 that connects two processing algorithms (first clip and than dissolve). The output vector from the clip is supposed to be an input into the dissolve.

The code of my processing script is provided here:

##clipped_layer=output vector
##processed_layer=output vector

clip_area = processing.runalg("qgis:clip", input_layer, clip_layer, 

fin_area = processing.runalg("qgis:dissolve", clip_area, "true", None, 

The screeshot of processing script UI when I try to run it is below:

UI of processing script

Both of the algorithms work correctly standalone, but when I try to pipe them it does not work as intended. I only get clipped_layer as output and the following error notification in Python Console:

enter image description here

There are several questions adressing related issues like Pipe custom processing algorithm output into another in QGIS 3.0 but none really answers my question.

Does anybody know how to correctly pipe algorithms in the example processing script provided above?

I know it could be solved by using Processing Modeler but since I plan to expand the script further, please, don´t suggest this as solution.

  • 2
    Try using fin_area = processing.runalg("qgis:dissolve", clip_area['OUTPUT'], "true", None, processed_layer)
    – Joseph
    Commented Apr 20, 2018 at 15:12

1 Answer 1


The processing.runalg() return a python dictionary with one record: 'OUTPUT' is the key and the value is the absolute path at result layer.

So in the next algorithm instead of the parameter clip_area you have to use clip_area['OUTPUT']

  • Yes, you need to specify the 'OUTPUT' with the output layer. This worked for me. Thanks Does this work for all kind of algorithms with spatial outputs?
    – Yanic
    Commented Apr 23, 2018 at 7:48
  • 1
    Sometimes changes the key string value 'OUTPUT', you have to print the dictionary result to know it... Take care that all of this is heavily changed in QGIS 3.0 Commented Apr 23, 2018 at 8:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.