Write the classification prompt
The prompt must force the model to return structured JSON. Natural language output cannot be reliably parsed.
Step 1
In the OpenAI action step, set the 'User Message' to this classification prompt, replacing the categories with your actual policy table categories:
Step 2
TASK: Classify the email below into exactly one intent category. Return ONLY valid JSON with no explanation or preamble.
Step 3
CATEGORIES: inquiry, follow-up, support, billing, legal, unknown
Step 4
OUTPUT FORMAT: { "intent": "<category>", "confidence": <0.0 to 1.0>, "risk_flag": <true if billing/legal/unknown>, "missing_context": "<one sentence about what context would improve this classification, or null>" }
Step 5
EMAIL CONTENT: [Normalized text from previous step]
Step 6
In the 'System' message field, type: 'You are an email classification system. Always respond with valid JSON only. Never include explanation or markdown formatting.'