{
  "version": 1,
  "structures": [
    {
      "name": "billing_triage_response",
      "description": "Classification of the billing inquiry",
      "example": {
        "inquiry_type": "failed_payment",
        "urgency": "high",
        "customer_intent": "wants to update payment method",
        "needs_agent": false
      },
      "schema": {
        "type": "object",
        "properties": {
          "inquiry_type": {
            "type": "string",
            "enum": [
              "invoice_question",
              "failed_payment",
              "plan_change",
              "refund_question",
              "other"
            ]
          },
          "urgency": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "customer_intent": {
            "type": "string"
          },
          "needs_agent": {
            "type": "boolean"
          }
        },
        "required": [
          "inquiry_type",
          "urgency",
          "customer_intent",
          "needs_agent"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "billing_resolution_response",
      "description": "Drafted resolution and customer reply",
      "example": {
        "resolution_summary": "Customer's payment failed; the card was declined.",
        "customer_reply": "Your payment didn't go through - please update your card and we'll retry automatically.",
        "next_steps": [
          "Update payment method in settings",
          "Contact support if the charge appears twice"
        ]
      },
      "schema": {
        "type": "object",
        "properties": {
          "resolution_summary": {
            "type": "string"
          },
          "customer_reply": {
            "type": "string"
          },
          "next_steps": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "resolution_summary",
          "customer_reply",
          "next_steps"
        ],
        "additionalProperties": false
      }
    }
  ],
  "workflows": [
    {
      "name": "billing_triage_workflow",
      "description": "Classifies the billing inquiry and starts resolution",
      "provider": "openai",
      "model": "gpt-5.6-terra",
      "backups": [
        {
          "provider": "anthropic",
          "model": "claude-haiku-4-5-20251001"
        }
      ],
      "request_type": "chat",
      "system_instructions": "Classify the billing inquiry type, set urgency, and summarize what the customer wants. Flag anything that needs a finance or support agent.",
      "structure": "billing_triage_response",
      "customer_fields": [
        "customer_id",
        "invoice_number",
        "customer_message"
      ],
      "test_mode": false,
      "cache_window_seconds": 600,
      "backend_pipeline": {
        "enabled": true,
        "events": [
          {
            "name": "inquiry_received"
          },
          {
            "name": "draft_resolution",
            "target_workflow": "billing_resolution_workflow"
          },
          {
            "name": "resolution_ready"
          }
        ]
      }
    },
    {
      "name": "billing_resolution_workflow",
      "description": "Drafts a clear resolution reply for the customer",
      "provider": "anthropic",
      "model": "claude-haiku-4-5-20251001",
      "backups": [
        {
          "provider": "openai",
          "model": "gpt-5.6-terra"
        }
      ],
      "request_type": "chat",
      "system_instructions": "Write a clear, reassuring reply for the billing inquiry. Summarize the resolution, include next steps the customer can take, and never promise amounts or refunds that were not provided in the message.",
      "structure": "billing_resolution_response",
      "customer_fields": [
        "customer_id",
        "invoice_number",
        "customer_message"
      ],
      "test_mode": false
    }
  ]
}
