Get non-archived workflows using the API

Hi!

I am trying to query workflows that are not archived using the API. However i cant seem to find a parameter that excludes the non archived ones.

Am I missing something ? NOTE, I am not talking about “active”, I am talking about “archived”

Thank you!

1 Like

Hi @tha_asp Welcome!
Currently the GET /workflows endpoint does not currently include an archivedflows, i can say that you can get all the workflows and then filter out the archived ones by checking their status, Although this would be a good feature request! API needs some love!

thank you for the answer @Anshul_Namdev , this would be an option but I just noticed that the stubs generated by the openapi json specification have many fields missing, like the archived.

The json specification seems to be a bit limited.

@tha_asp as i said, this would be a good feature request.

I think that adding a query parameter on the API is indeed a good feature request,

I would consider a non-accurate openapi schema more of a bug or incomplete implementation.

this is the current workflow object as documented

“workflow”: {

    "type": "object",

    "additionalProperties": false,

    "required": \[

      "name",

      "nodes",

      "connections",

      "settings"

    \],

    "properties": {

      "id": {

        "type": "string",

        "readOnly": true,

        "example": "2tUt1wbLX592XDdX"

      },

      "name": {

        "type": "string",

        "example": "Workflow 1"

      },

      "active": {

        "type": "boolean",

        "readOnly": true

      },

      "createdAt": {

        "type": "string",

        "format": "date-time",

        "readOnly": true

      },

      "updatedAt": {

        "type": "string",

        "format": "date-time",

        "readOnly": true

      },

      "nodes": {

        "type": "array",

        "items": {

          "$ref": "#/components/schemas/node"

        }

      },

      "connections": {

        "type": "object",

        "example": {

          "Jira": {

            "main": \[

              \[

                {

                  "node": "Jira",

                  "type": "main",

                  "index": 0

                }

              \]

            \]

          }

        }

      },

      "settings": {

        "$ref": "#/components/schemas/workflowSettings"

      },

      "staticData": {

        "example": {

          "lastId": 1

        },

        "anyOf": \[

          {

            "type": "string",

            "format": "jsonString",

            "nullable": true

          },

          {

            "type": "object",

            "nullable": true

          }

        \]

      },

      "tags": {

        "type": "array",

        "items": {

          "$ref": "#/components/schemas/tag"

        },

        "readOnly": true

      },

      "shared": {

        "type": "array",

        "items": {

          "$ref": "#/components/schemas/sharedWorkflow"

        }

      },

      "activeVersion": {

        "$ref": "#/components/schemas/activeVersion"

      }

    }

  },

@tha_asp you are right about the current limitation of the API, i guess with workflow you can try Return All is true also remove all the return only active workflow parameters to get the proper list, you can also raise a bug for this!

1 Like

thank you for your support!

1 Like