Skip to content

Create a new chatflow using API not preserve id anymore #6418

@mcpata2002

Description

@mcpata2002

Describe the bug

I used to backup flows using GET /api/v1/chatflows/{flow_id} and restore to stand-by server by POST /api/v1/chatflows with the exact JSON file.

My flowise running under docker also get version update automatically that both servers catch up with latest version.

It's been a while I didn't check it but suddenly I see a lot of agent flows in the stand-by server with the same name. After investigation, I found that even I keep the "id" in the JSON file and POST to create a new chatflow ( I have an curl -X DELETE beforehand that will remove the flow first) the return JSON give me another "id", and .... it create a new flow per POST.

How can I preserve the flow id across different flowise server then?

To Reproduce

Backup from 172.16.201.43:3000

curl -X GET -H "Authorization: Bearer $SRC_KEY"
http://172.16.201.43:3000/api/v1/chatflows/c4051390-cba3-4e3a-bdba-940c6503865b \

c4051390-cba3-4e3a-bdba-940c6503865b.json

Delete flow on 172.16.100.48:3000, if exists

curl -X DELETE -H "Authorization: Bearer $DST_KEY"
http://172.16.100.48:3000/api/v1/chatflows/c4051390-cba3-4e3a-bdba-940c6503865b

Create the flow on 172.16.100.48:3000

curl -X POST -H "Authorization: Bearer $DST_KEY"
http://172.16.100.48:3000/api/v1/chatflows
-H "Content-Type: application/json"
-d c4051390-cba3-4e3a-bdba-940c6503865b.json

Expected behavior

The flow created on 172.16.100.48:3000 should have the same flow id so that API_URL used to invoke the flow: /api/v1/prediction/{flow_id} preserved.

Screenshots

No response

Flow

No response

Use Method

Docker

Flowise Version

3.1.2

Operating System

Linux

Browser

Other

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions