Duplicate a workflow
workflow:writeCopies the workflow's DRAFT definition into a brand-new workflow named "<original name> (Copy)" (truncated so the result never exceeds 255 characters). The copy is always a draft, whatever the original's status, and gets its OWN freshly generated webhook token inside the definition — it can never receive traffic on the original's URL, and stays inert until you publish it.
There is no request body: the new name is not settable here. Rename it afterwards with PUT /api/workflows/{id}. NOT copied: tags, folder, version history, runs, test payloads and pinned data. Copied: the definition, description, trigger type, and every step's pieceVersion pin and connectionId reference.
Authorization
bearerAuth An API token: Authorization: Bearer grt_…. Mint one in the app under Settings → Workspace → API tokens; the raw value is shown once. Scopes confine the token — see x-permission on each operation.
In: header
Path Parameters
Id of the workflow to copy.
uuidHeader Parameters
Opt-in replay protection, max 255 characters. A retry with the same key replays the original 201 (Idempotency-Replayed: true) instead of creating a second copy. Reusing the key with a different request returns 422; while the first is still running it returns 409. Records are kept 24 hours.
length <= 255Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/workflows/497f6eca-6276-4993-bfeb-53cbbbba6f08/duplicate"{ "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "description": "string", "definition": { "schemaVersion": 2, "trigger": { "name": "string", "displayName": "string", "type": "manual", "pieceId": "string", "pieceVersion": "string", "actionId": "string", "config": {}, "connectionId": "string", "valid": true, "nextAction": { "name": "string", "displayName": "string", "type": "PIECE", "pieceId": "string", "pieceVersion": "string", "actionId": "string", "config": {}, "connectionId": "string", "valid": true, "skip": true, "nextAction": {}, "branches": [ { "name": "string", "conditions": [ [ { "field": "string", "operator": "text_eq", "value": null } ] ], "firstAction": {} } ], "firstLoopAction": {}, "onErrorAction": {} } }, "settings": { "timeoutSeconds": 0, "errorWorkflowId": "51d8ee47-3646-4ae6-bc48-c85415c9166a", "concurrencyLimit": 0, "maintenanceMode": true, "autoPublishFixes": true }, "annotations": null, "variables": {}, "pinnedData": {} }, "status": "draft", "triggerType": "manual", "cronExpression": "string", "webhookToken": "string", "latestVersionId": "750445c5-7ad9-40bd-a593-bb37d7d846db", "definitionRev": 0, "hasUnpublishedChanges": true, "folderId": "5b6379a4-2a6c-4085-b184-45838a3b8e7e", "tags": [ "string" ], "testPayloads": {}, "pinnedData": {}, "workspaceId": "ef0efa32-d1c1-43d4-a5e2-fe7b4f00403c", "orgId": "25b2c2d5-a7fc-47d0-89e4-8709a1560bfa", "createdBy": "25a02396-1048-48f9-bf93-102d2fb7895e", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "lastRun": { "status": "pending", "startedAt": "2019-08-24T14:15:22Z" } }}