{
    "name": "Warning 2 (30% Absence)",
    "nodes": [
        {
            "parameters": {
                "httpMethod": "POST",
                "path": "warning-second",
                "options": []
            },
            "id": "node-trigger-warning-second",
            "name": "Webhook Trigger",
            "type": "n8n-nodes-base.webhook",
            "typeVersion": 1,
            "position": [
                100,
                240
            ]
        },
        {
            "parameters": {
                "fieldToSplitBy": "candidates",
                "options": []
            },
            "id": "node-split-warning-second",
            "name": "Split Candidates",
            "type": "n8n-nodes-base.splitInBatches",
            "typeVersion": 2,
            "position": [
                280,
                240
            ]
        },
        {
            "parameters": {
                "method": "POST",
                "url": "https://albsaer.bzzix.com/api/automation/send-whatsapp",
                "authentication": "genericCredentialType",
                "genericAuthType": "httpHeaderAuth",
                "sendBody": true,
                "specifyBody": "json",
                "jsonBody": "={\n  \"phone\": \"{{ $json.student_whatsapp }}\",\n  \"template\": \"student_warning_pdf\",\n  \"variables\": [\n    \"{{ $json.student_name }}\",\n    \"الثاني\",\n    \"{{ $json.absence_percentage }}\"\n  ]\n}",
                "options": {}
            },
            "id": "node-whatsapp-warning-second",
            "name": "Send WhatsApp (Respond.io)",
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 4.1,
            "position": [
                480,
                240
            ],
            "credentials": {
                "httpHeaderAuth": {
                    "id": "LaravelTokenCredential",
                    "name": "Laravel API Token"
                }
            },
            "settings": {
                "onError": "continue"
            }
        },
        {
            "parameters": {
                "method": "POST",
                "url": "https://albsaer.bzzix.com/api/automation/record-warning",
                "authentication": "genericCredentialType",
                "genericAuthType": "httpHeaderAuth",
                "sendBody": true,
                "specifyBody": "json",
                "jsonBody": "={\n  \"student_id\": {{ $json.student_id }},\n  \"warning_type\": \"second\",\n  \"absence_percentage\": {{ $json.absence_percentage }},\n  \"recorded_at\": \"{{ now().toIso8601String() }}\"\n}",
                "options": []
            },
            "id": "node-laravel-warning-second",
            "name": "Record Warning in Laravel",
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 4.1,
            "position": [
                680,
                240
            ],
            "credentials": {
                "httpHeaderAuth": {
                    "id": "LaravelTokenCredential",
                    "name": "Laravel API Token"
                }
            }
        }
    ],
    "connections": {
        "Webhook Trigger": {
            "main": [
                [
                    {
                        "node": "Split Candidates",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Split Candidates": {
            "main": [
                [
                    {
                        "node": "Send WhatsApp (Respond.io)",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Send WhatsApp (Respond.io)": {
            "main": [
                [
                    {
                        "node": "Record Warning in Laravel",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        }
    },
    "active": false,
    "settings": {
        "executionOrder": "v1"
    },
    "versionId": "warning-second-version-1",
    "meta": {
        "templateCredsSetupCompleted": true
    },
    "id": "warningSecondWorkflow"
}