To create the copy, we will first get the flow metadata from the api/draw/1/flow/(id) endpoint, remove the id value, change the developerName value, and send a POST request back to api/draw/1/flow.
Here is how:
Say, there is a flow with the Flow ID as c2d43d5f-3e22-4f9f-86d8-fccb9745268b.
- Click API.
- Copy paste api/draw/1/flow/(id) in the address field, and replace (id) with the Flow ID of the flow we want to copy.
- Click GET. This gives us the metadata of the flow in the Response column.
- Copy the entire metadata and paste it in the Request column.
- We will delete the id value. The Flow engine will generate a different value for us.
- We will change the developerName value to something else.
- Copy-paste api/draw/1/flow in the address field.
- Click POST. This creates a shallow copy of the flow.
If we have a flow, and want to create a similar flow with minor changes, another option is to import the flow in a new subtenant.
What is the difference between ‘deep’ and ‘shallow’ copies? This is good to know.