diff --git a/n8n-workflows/workflow-a-http.json b/n8n-workflows/workflow-a-http.json index cabafc9..2ccc5cc 100644 --- a/n8n-workflows/workflow-a-http.json +++ b/n8n-workflows/workflow-a-http.json @@ -110,13 +110,18 @@ "assignments": [ { "name": "response_text", - "value": "={{ $json.choices[0].message.content }}", + "value": "={{ $json.choices?.[0]?.message?.content || '{}' }}", "type": "string" }, { "name": "ai_response", - "value": "={{ JSON.parse($json.response_text) }}", + "value": "={{ typeof $json.response_text === 'string' ? JSON.parse($json.response_text) : $json.response_text }}", "type": "object" + }, + { + "name": "vertrauen", + "value": "={{ $json.ai_response?.vertrauen || 0.5 }}", + "type": "number" } ] } @@ -138,7 +143,7 @@ "conditions": [ { "id": "condition_1", - "leftValue": "={{ $json.ai_response.vertrauen }}", + "leftValue": "={{ $json.vertrauen }}", "rightValue": 0.6, "operator": { "name": "filter.operator.gte", @@ -183,7 +188,7 @@ }, { "name": "reason", - "value": "Confidence {{$json.ai_response.vertrauen}} < 0.6", + "value": "Confidence {{$json.vertrauen}} < 0.6", "type": "string" } ]