{
  "version": 1,
  "structures": [
    {
      "name": "feedback_triage_response",
      "description": "Classification of the customer feedback",
      "example": {
        "sentiment": "negative",
        "topic": "onboarding",
        "rating_seen": 3,
        "needs_follow_up": true
      },
      "schema": {
        "type": "object",
        "properties": {
          "sentiment": {
            "type": "string",
            "enum": [
              "positive",
              "neutral",
              "negative"
            ]
          },
          "topic": {
            "type": "string"
          },
          "rating_seen": {
            "type": "number"
          },
          "needs_follow_up": {
            "type": "boolean"
          }
        },
        "required": [
          "sentiment",
          "topic",
          "rating_seen",
          "needs_follow_up"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "feedback_reply_response",
      "description": "Drafted reply to the customer",
      "example": {
        "reply_tone": "apologetic",
        "customer_reply": "Thanks for flagging this - we're sorry onboarding was confusing, and we're on it.",
        "follow_up_action": "Share the fix when onboarding is improved"
      },
      "schema": {
        "type": "object",
        "properties": {
          "reply_tone": {
            "type": "string",
            "enum": [
              "appreciative",
              "apologetic",
              "neutral"
            ]
          },
          "customer_reply": {
            "type": "string"
          },
          "follow_up_action": {
            "type": "string"
          }
        },
        "required": [
          "reply_tone",
          "customer_reply",
          "follow_up_action"
        ],
        "additionalProperties": false
      }
    }
  ],
  "workflows": [
    {
      "name": "feedback_triage_workflow",
      "description": "Classifies feedback and starts the reply pipeline",
      "provider": "openai",
      "model": "gpt-5.6-terra",
      "backups": [
        {
          "provider": "anthropic",
          "model": "claude-haiku-4-5-20251001"
        }
      ],
      "request_type": "chat",
      "system_instructions": "Classify the customer feedback: sentiment, topic, the rating they gave, and whether a follow-up is needed. Be objective and concise.",
      "structure": "feedback_triage_response",
      "customer_fields": [
        "customer_name",
        "feedback_text",
        "rating"
      ],
      "test_mode": false,
      "cache_window_seconds": 600,
      "backend_pipeline": {
        "enabled": true,
        "events": [
          {
            "name": "feedback_submitted"
          },
          {
            "name": "draft_reply",
            "target_workflow": "feedback_reply_workflow"
          },
          {
            "name": "reply_ready"
          }
        ]
      }
    },
    {
      "name": "feedback_reply_workflow",
      "description": "Drafts the right 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": "Draft a short reply matching the feedback: thank happy customers, apologize and take ownership for unhappy ones, and suggest a follow-up action for the team. Never make excuses.",
      "structure": "feedback_reply_response",
      "customer_fields": [
        "customer_name",
        "feedback_text",
        "rating"
      ],
      "test_mode": false
    }
  ]
}
