281 lines
6.3 KiB
JSON

{
"name": "Copilot Setup",
"nodes": [
{
"parameters": {
"inputSource": "passthrough"
},
"id": "c055762a-8fe7-4141-a639-df2372f30060",
"typeVersion": 1.1,
"name": "When Executed by Another Workflow",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [
-288,
192
]
},
{
"parameters": {
"constantsKeyName": "copilot"
},
"type": "n8n-nodes-globals.globalConstants",
"typeVersion": 1,
"position": [
-64,
0
],
"id": "5a51dc99-5c56-4e6e-ad67-52698f87fa4e",
"name": "Copilot Settings",
"notesInFlow": true,
"credentials": {
"globalConstantsApi": {
"id": "BAaySM6nkSxflDzN",
"name": "Copilot Settings - verint.com"
}
},
"notes": "Settings for Copilot"
},
{
"parameters": {},
"type": "n8n-nodes-globals.globalConstants",
"typeVersion": 1,
"position": [
-64,
384
],
"id": "57b5ca51-7c90-4c55-aace-3223cc46e368",
"name": "m2m - v2 - settings",
"credentials": {
"globalConstantsApi": {
"id": "gh5k8MY0pyS6Fbkc",
"name": "Work Assist - m2m - v2 - 78ab8a80-88a3-4db0-a3f9-36e7aeef18db"
}
}
},
{
"parameters": {
"method": "POST",
"url": "https://api.verint.com/vcp/identity-dev/integration/auth/v2/oauth/token",
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "grant_type",
"value": "client_credentials"
},
{
"name": "client_id",
"value": "={{ $json.constants.client_id_v2 }}"
},
{
"name": "client_secret",
"value": "={{ $json.constants.client_secret_v2 }}"
},
{
"name": "audience",
"value": "api://vcp/wa-cloudevent"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
160,
384
],
"id": "e537cdb1-c5f6-4883-98ba-e883dd963e96",
"name": "V2 Auth Token"
},
{
"parameters": {
"jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nconst uuid = require('uuid');\n\nreturn { \n call_uuid: uuid.v4(),\n conversationId: uuid.v4()\n};"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-64,
192
],
"id": "10edfbda-aa32-437a-b7f5-a0f86090ec5a",
"name": "UUIDs"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineAll",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
160,
96
],
"id": "35cf8d14-be4f-4517-8525-5644158f9d41",
"name": "Merge"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "b585e94c-5a47-4278-8413-5825c02cdfeb",
"name": "copilot",
"value": "={{ $json.copilot }}",
"type": "object"
},
{
"id": "dfdc7d1a-4afe-402a-8b2e-0971d4188115",
"name": "call_uuid",
"value": "={{ $json.call_uuid }}",
"type": "string"
},
{
"id": "cebb1eb9-828b-44f8-b5e6-c062b629985a",
"name": "conversationId",
"value": "={{ $json.conversationId }}",
"type": "string"
},
{
"id": "eea41372-42da-4dc5-87f7-30263e332fc0",
"name": "v2_auth",
"value": "={ \n access_token: \"{{ $json.access_token }}\",\n token_type: \"{{ $json.token_type }}\"\n}",
"type": "object"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
608,
192
],
"id": "ac3446d5-fd95-4889-a6cd-5af021e4e4a2",
"name": "Edit Fields"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineAll",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
384,
192
],
"id": "9b038fd8-3182-4e8c-a0b1-056dff0f0c19",
"name": "Merge1"
}
],
"pinData": {},
"connections": {
"When Executed by Another Workflow": {
"main": [
[
{
"node": "Copilot Settings",
"type": "main",
"index": 0
},
{
"node": "UUIDs",
"type": "main",
"index": 0
},
{
"node": "m2m - v2 - settings",
"type": "main",
"index": 0
}
]
]
},
"Copilot Settings": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"m2m - v2 - settings": {
"main": [
[
{
"node": "V2 Auth Token",
"type": "main",
"index": 0
}
]
]
},
"UUIDs": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 0
}
]
]
},
"V2 Auth Token": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 1
}
]
]
},
"Edit Fields": {
"main": [
[]
]
},
"Merge1": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "019c4940-4f70-4e41-a24c-a3eecf367a9a",
"meta": {
"instanceId": "1d14171834eac77e3e796e3342933fbc57a33295e898b249017b9d12b57d9e0c"
},
"id": "YynY08QotHPGCfC3",
"tags": []
}