Skip to content

Get chatflow by ID endpoint returns 500 when it should return 4xx #5379

@salimzdn

Description

@salimzdn

Describe the bug

The chatflow API does not work as expected and as described in the documentation.

When getting chatflow by ID, with an invalid id, or a not existing id, instead of receiving a 400 or a 404 status code, status code is 500 with the following response

{ "statusCode": 500, "success": false, "message": "Error: chatflowsService.getChatflowById - Chatflow e not found in the database!", "stack": {} }

To Reproduce

Getting chatflow by ID, with an invalid id

  1. Use chatflow - Get chatflow by ID endpoint : .../chatflows/invalid-id
  2. Response is an error with statusCode 500 instead of 400

Getting chatflow by ID, with a not existing id

  1. Use chatflow - Get chatflow by ID endpoint : .../chatflows/dafb70a2-c258-4a36-ae81-2a401c7cd147 (where no chatflow has this id)
  2. Response is an error with statusCode 500 instead of 404

Expected behavior

Getting chatflow by ID, with an invalid id

  • Expected statusCode is 400

Getting chatflow by ID, with a not existing id

  • Expected statusCode is 404

Screenshots

No response

Flow

No response

Use Method

None

Flowise Version

No response

Operating System

None

Browser

None

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions