Copy a Workflow

Hand off to an LLM

Copy a workflow to a new name.

Forks the source workflow's current version into a brand-new workflow at versionNum: 1. The full node graph and edges are carried over, but the functions the copied nodes reference are shared, not duplicated — both workflows now point at the same functions.

Useful for forking a production workflow to test a topology change without disturbing the live caller.

POST
/v3/workflows/copy
x-api-key<token>

Authenticate using API Key in request header

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://api.bem.ai/v3/workflows/copy" \  -H "Content-Type: application/json" \  -d '{    "sourceWorkflowName": "string",    "targetWorkflowName": "string"  }'
{
  "environment": "string",
  "workflow": {
    "id": "string",
    "name": "string",
    "versionNum": 0,
    "displayName": "string",
    "emailAddress": "string",
    "tags": [
      "string"
    ],
    "mainNodeName": "string",
    "nodes": [
      {
        "name": "string",
        "function": {
          "id": "string",
          "name": "string",
          "versionNum": 0
        },
        "metadata": {}
      }
    ],
    "edges": [
      {
        "sourceNodeName": "string",
        "destinationName": "string",
        "destinationNodeName": "string",
        "metadata": {}
      }
    ],
    "connectors": [
      {
        "connectorID": "string",
        "name": "string",
        "type": "paragon",
        "paragon": {
          "integration": "string",
          "configuration": {},
          "syncID": "string"
        }
      }
    ],
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "audit": {
      "workflowCreatedBy": {
        "userActionID": "string",
        "userID": "string",
        "userEmail": "string",
        "apiKeyName": "string",
        "emailAddress": "string",
        "createdAt": "2019-08-24T14:15:22Z"
      },
      "workflowLastUpdatedBy": {
        "userActionID": "string",
        "userID": "string",
        "userEmail": "string",
        "apiKeyName": "string",
        "emailAddress": "string",
        "createdAt": "2019-08-24T14:15:22Z"
      },
      "versionCreatedBy": {
        "userActionID": "string",
        "userID": "string",
        "userEmail": "string",
        "apiKeyName": "string",
        "emailAddress": "string",
        "createdAt": "2019-08-24T14:15:22Z"
      }
    }
  },
  "copiedFunctions": [
    {
      "sourceFunctionName": "string",
      "sourceFunctionID": "string",
      "sourceVersionNum": 1,
      "targetFunctionName": "string",
      "targetFunctionID": "string",
      "targetVersionNum": 1
    }
  ],
  "error": "string"
}
{
  "environment": "string",
  "workflow": {
    "id": "string",
    "name": "string",
    "versionNum": 0,
    "displayName": "string",
    "emailAddress": "string",
    "tags": [
      "string"
    ],
    "mainNodeName": "string",
    "nodes": [
      {
        "name": "string",
        "function": {
          "id": "string",
          "name": "string",
          "versionNum": 0
        },
        "metadata": {}
      }
    ],
    "edges": [
      {
        "sourceNodeName": "string",
        "destinationName": "string",
        "destinationNodeName": "string",
        "metadata": {}
      }
    ],
    "connectors": [
      {
        "connectorID": "string",
        "name": "string",
        "type": "paragon",
        "paragon": {
          "integration": "string",
          "configuration": {},
          "syncID": "string"
        }
      }
    ],
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "audit": {
      "workflowCreatedBy": {
        "userActionID": "string",
        "userID": "string",
        "userEmail": "string",
        "apiKeyName": "string",
        "emailAddress": "string",
        "createdAt": "2019-08-24T14:15:22Z"
      },
      "workflowLastUpdatedBy": {
        "userActionID": "string",
        "userID": "string",
        "userEmail": "string",
        "apiKeyName": "string",
        "emailAddress": "string",
        "createdAt": "2019-08-24T14:15:22Z"
      },
      "versionCreatedBy": {
        "userActionID": "string",
        "userID": "string",
        "userEmail": "string",
        "apiKeyName": "string",
        "emailAddress": "string",
        "createdAt": "2019-08-24T14:15:22Z"
      }
    }
  },
  "copiedFunctions": [
    {
      "sourceFunctionName": "string",
      "sourceFunctionID": "string",
      "sourceVersionNum": 1,
      "targetFunctionName": "string",
      "targetFunctionID": "string",
      "targetVersionNum": 1
    }
  ],
  "error": "string"
}
{
  "environment": "string",
  "workflow": {
    "id": "string",
    "name": "string",
    "versionNum": 0,
    "displayName": "string",
    "emailAddress": "string",
    "tags": [
      "string"
    ],
    "mainNodeName": "string",
    "nodes": [
      {
        "name": "string",
        "function": {
          "id": "string",
          "name": "string",
          "versionNum": 0
        },
        "metadata": {}
      }
    ],
    "edges": [
      {
        "sourceNodeName": "string",
        "destinationName": "string",
        "destinationNodeName": "string",
        "metadata": {}
      }
    ],
    "connectors": [
      {
        "connectorID": "string",
        "name": "string",
        "type": "paragon",
        "paragon": {
          "integration": "string",
          "configuration": {},
          "syncID": "string"
        }
      }
    ],
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "audit": {
      "workflowCreatedBy": {
        "userActionID": "string",
        "userID": "string",
        "userEmail": "string",
        "apiKeyName": "string",
        "emailAddress": "string",
        "createdAt": "2019-08-24T14:15:22Z"
      },
      "workflowLastUpdatedBy": {
        "userActionID": "string",
        "userID": "string",
        "userEmail": "string",
        "apiKeyName": "string",
        "emailAddress": "string",
        "createdAt": "2019-08-24T14:15:22Z"
      },
      "versionCreatedBy": {
        "userActionID": "string",
        "userID": "string",
        "userEmail": "string",
        "apiKeyName": "string",
        "emailAddress": "string",
        "createdAt": "2019-08-24T14:15:22Z"
      }
    }
  },
  "copiedFunctions": [
    {
      "sourceFunctionName": "string",
      "sourceFunctionID": "string",
      "sourceVersionNum": 1,
      "targetFunctionName": "string",
      "targetFunctionID": "string",
      "targetVersionNum": 1
    }
  ],
  "error": "string"
}

See also