See Stacksync in action with a solution architect. Book a demo ↗
Workflows

Workflows

Duplicate workflow

POST
/v1/workspaces/{workspace_id}/workflows/{workflow_id}/duplicate

Copy a version of a workflow into a new workflow (its first draft), in the same or another region, with its schedules.

Authorization

Authorizationstringheaderrequired

Bearer <key>, where <key> is a workspace API key or a user API key. See Authentication.

Path Parameters

workspace_id*integer

The workspace. List the ones your key can reach with GET /v1/workspaces.

workflow_id*string

The workflow.

Formatuuid

Query Parameters

region*Regions

Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them

Value in"besg""usnv"

Header Parameters

Idempotency-Key?|

Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.

Defaultnull

Request Body

application/json
  1. body
workflow_name*Workflow Name
Length1 <= length <= 200
is_shared_with_workspace?|
Defaultnull
version?|

The version copied; the latest when absent

Defaultnull
copy_region?|

The region of the copy; the workflow's region when absent

Defaultnull
validate_only?Validate Only

Run every check of the write and answer 204 without writing: a refused write answers the error the write would

Defaultfalse

Response Body

Created

application/json
  1. response
workflow_id*Workflow Id
workflow_name*Workflow Name
region*Regions
Value in"besg""usnv"
version*

A version without its document; step_ids lists its steps (workflow_module_instance_id)

triggers*array<>
Duplicate workflow
curl -X POST 'https://api.stacksync.com/v1/workspaces/0/workflows/497f6eca-6276-4993-bfeb-53cbbbba6f08/duplicate?region=besg' \  -H 'Content-Type: application/json' \  -d '{  "workflow_name": "<workflow_name>"}'
{  "workflow_id": "<workflow_id>",  "workflow_name": "<workflow_name>",  "region": "besg",  "version": {    "workflow_version": "<workflow_version>",    "is_draft": false,    "is_deployed": false,    "last_modified_time": "<last_modified_time>",    "step_ids": [      "<step_ids>"    ]  },  "triggers": [    {      "step_id": "<step_id>",      "status": "succeeded",      "msg": "<msg>"    }  ]}