{
        "description": "Escalate to support when retry count exceeds maximum",
        "priority": 10,
        "condition": "retry_count >= max_retries",
        "steps": [
            {
                "step": 1,
                "action": "query",
                "name": "get_submission",
                "query": "SELECT * FROM taxcore_submissions WHERE submission_id = ${record.submission_id}"
            },
            {
                "step": 2,
                "action": "update",
                "name": "remove_from_queue",
                "table": "taxcore_queue",
                "where": {"queue_id": "${record.queue_id}"},
                "data": {"status": "exceeded"}
            },
            {
                "step": 3,
                "action": "update",
                "name": "mark_failed",
                "table": "taxcore_submissions",
                "where": {"submission_id": "${record.submission_id}"},
                "data": {
                    "status": "failed",
                    "error_message": "Max retries exceeded"
                }
            },
            {
                "step": 4,
                "action": "insert",
                "name": "create_support_ticket",
                "table": "support_tickets",
                "data": {
                    "org_id": "${step1.org_id}",
                    "type": "taxcore_retry_exceeded",
                    "priority": "high",
                    "subject": "TaxCore Submission Failed: ${step1.reference_table} ${step1.reference_id}",
                    "description": "Submission ${step1.submission_id} failed after ${record.retry_count} retry attempts"
                }
            },
            {
                "step": 5,
                "action": "email",
                "name": "email_support",
                "to": "support@example.com",
                "subject": "URGENT: TaxCore Retry Exceeded",
                "template": "taxcore_escalation",
                "data": {
                    "submission": "${step1}",
                    "queue": "${record}"
                }
            }
        ]
    }