{
        "description": "Escalate to support when max retry attempts are exceeded",
        "priority": 10,
        "steps": [
            {
                "step": 1,
                "action": "query",
                "name": "get_submission",
                "query": "SELECT * FROM taxcore_submissions WHERE submission_id = ${record.submission_id}",
                "required": true
            },
            {
                "step": 2,
                "action": "update",
                "name": "mark_failed",
                "query": "UPDATE taxcore_submissions SET status = 'failed', error_message = 'Max retry attempts exceeded' WHERE submission_id = ${record.submission_id}",
                "required": true
            },
            {
                "step": 3,
                "action": "insert",
                "name": "create_support_ticket",
                "query": "INSERT INTO support_tickets (org_id, title, description, priority, status, category) VALUES (${step1.result[0].org_id}, 'TaxCore Submission Failed', 'Submission ${record.submission_id} failed after maximum retry attempts', 'high', 'open', 'taxcore')",
                "required": false
            },
            {
                "step": 4,
                "action": "email",
                "name": "email_support",
                "to": "support@taxcore.example.com",
                "subject": "TaxCore Max Retries Exceeded - ${step1.result[0].org_tin}",
                "template": "taxcore_escalation",
                "data": "${step1.result[0]}"
            },
            {
                "step": 5,
                "action": "trigger_event",
                "name": "trigger_failure_event",
                "event": "taxcore:submission:failed",
                "data": "${record}"
            }
        ]
    }