{ "name": "Analyze a URL with Cortex", "nodes": [ { "name": "On clicking 'execute'", "type": "n8n-nodes-base.manualTrigger", "position": [ 370, 220 ], "parameters": {}, "typeVersion": 1, "id": "analyze-url-with-cortex-0" }, { "name": "Set analysis details", "type": "n8n-nodes-base.code", "typeVersion": 2, "parameters": { "mode": "runOnceForAllItems", "jsCode": "const analyzerId='',url='';if(!/^[a-zA-Z0-9_-]+$/.test(analyzerId)||!/^https?:\\/\\/[^\\s]+$/i.test(url))throw Error('Enter a valid analyzer ID and URL');return [{json:{analyzerId,url}}];" }, "id": "analyze-url-with-cortex-1" }, { "name": "Cortex", "type": "n8n-nodes-base.cortex", "position": [ 570, 220 ], "parameters": { "analyzer": "={{ $(\"Set analysis details\").first().json.analyzerId + \"::Configured\" }}", "observableType": "url", "observableValue": "={{ $(\"Set analysis details\").first().json.url }}", "additionalFields": {} }, "typeVersion": 1, "id": "analyze-url-with-cortex-2" }, { "name": "Confirm job ID", "type": "n8n-nodes-base.code", "typeVersion": 2, "parameters": { "mode": "runOnceForAllItems", "jsCode": "const id=$input.first().json.id;if(typeof id!=='string'||!/^[a-zA-Z0-9_-]+$/.test(id))throw Error('Cortex did not return a valid job ID');return $input.all();" }, "id": "analyze-url-with-cortex-3" }, { "name": "Cortex1", "type": "n8n-nodes-base.cortex", "position": [ 770, 220 ], "parameters": { "jobId": "={{ $(\"Confirm job ID\").first().json.id }}", "resource": "job" }, "typeVersion": 1, "id": "analyze-url-with-cortex-4" }, { "name": "Verify job", "type": "n8n-nodes-base.code", "typeVersion": 2, "parameters": { "mode": "runOnceForAllItems", "jsCode": "const job=$input.first().json;if(!job||job.id!==$('Confirm job ID').first().json.id)throw Error('Cortex did not return the submitted job');return $input.all();" }, "id": "analyze-url-with-cortex-5" } ], "active": false, "settings": {}, "connections": { "On clicking 'execute'": { "main": [ [ { "node": "Set analysis details", "type": "main", "index": 0 } ] ] }, "Set analysis details": { "main": [ [ { "node": "Cortex", "type": "main", "index": 0 } ] ] }, "Cortex": { "main": [ [ { "node": "Confirm job ID", "type": "main", "index": 0 } ] ] }, "Confirm job ID": { "main": [ [ { "node": "Cortex1", "type": "main", "index": 0 } ] ] }, "Cortex1": { "main": [ [ { "node": "Verify job", "type": "main", "index": 0 } ] ] } }, "pinData": {} }