Copy a Workflow
Copy a workflow to a new workflow with a different name. Can optionally copy to a different environment or copy a specific version of the workflow. When copying to a different environment, all functions used in the workflow will also be copied.
Authenticate using API Key in request header
In: header
Name of the source workflow to copy from.
^[a-zA-Z0-9_-]{1,128}$1 <= length <= 128Optional version number of the source workflow to copy. If not provided, copies the current version.
uint1 <= valueOptional target environment name. If provided, copies the workflow to a different environment. When copying to a different environment, all functions used in the workflow will also be copied.
Name for the new copied workflow. Must be unique within the target environment.
^[a-zA-Z0-9_-]{1,128}$1 <= length <= 128Optional display name for the copied workflow. If not provided, uses the source workflow's display name with " (Copy)" appended.
Optional tags for the copied workflow. If not provided, uses the source workflow's tags.
Response Body
curl -X POST "https://api.bem.ai/v2/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": [
"billing",
"finance",
"automated"
],
"mainFunction": {
"id": "string",
"name": "string",
"versionNum": 0
},
"relationships": [
{
"sourceFunction": {
"id": "string",
"name": "string",
"versionNum": 0
},
"destinationName": "string",
"destinationFunction": {
"id": "string",
"name": "string",
"versionNum": 0
}
}
],
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "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": [
"billing",
"finance",
"automated"
],
"mainFunction": {
"id": "string",
"name": "string",
"versionNum": 0
},
"relationships": [
{
"sourceFunction": {
"id": "string",
"name": "string",
"versionNum": 0
},
"destinationName": "string",
"destinationFunction": {
"id": "string",
"name": "string",
"versionNum": 0
}
}
],
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "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": [
"billing",
"finance",
"automated"
],
"mainFunction": {
"id": "string",
"name": "string",
"versionNum": 0
},
"relationships": [
{
"sourceFunction": {
"id": "string",
"name": "string",
"versionNum": 0
},
"destinationName": "string",
"destinationFunction": {
"id": "string",
"name": "string",
"versionNum": 0
}
}
],
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
},
"copiedFunctions": [
{
"sourceFunctionName": "string",
"sourceFunctionID": "string",
"sourceVersionNum": 1,
"targetFunctionName": "string",
"targetFunctionID": "string",
"targetVersionNum": 1
}
],
"error": "string"
}