Reply to a ticket with an AI draft
A support agent opens a ticket and asks an AI assistant to draft a reply and a refund. The agent edits, sends or rejects the draft, and a refund over $100 needs a team lead's approval; an experiment sends simple drafts with no refund without the agent's review. If the assistant fails, the agent writes the reply by hand; if no draft arrives within 30 seconds, a toast sends the agent back to the ticket to try again.
What UJN shows here Point at a note to see its part of the drawing
The source (47 lines)
ai-approval.puml
@startujnrender { direction: down; arrow_spacing: 24 }journey AI_REPLY "Reply to a ticket with an AI draft"description: "An AI assistant drafts the reply and the refund; the agent decides what is sent"unique_id_friendly: ai_reply start from_queue { description: "Agent opens a ticket" }view ticket { title: "Ticket"; description: "Customer message and order"; route: /tickets/:id }action ask_ai { title: "Ask for a draft"; description: "Removes card data" }system assistant { type: external; title: "AI assistant"; host: api.ai.example }view drafting { type: waiting; title: "Drafting a reply"; description: "Until the draft arrives" }action draft_ready { type: event; title: "Draft arrives"; timeout: 30 s }view no_draft { type: toast; title: "No draft yet"; description: "Try again from the ticket" }view review { title: "Review draft"; description: "Edit the reply and refund amount"; route: /tickets/:id/draft }view write_reply { title: "Reply editor"; description: "Written by hand"; route: /tickets/:id/reply }action submit { title: "Check refund"; description: "Limit is $100" }actor lead { title: "Team lead"; role: Support lead }action issue_refund { title: "Issue refund" }action send_reply { type: message; title: "Send reply"; channel: email }end sent { type: success; description: "Customer answered" } from_queue --> ticketticket --> ask_ai : [Draft with AI]ask_ai --> assistant{ payload: [ticket_text, order_items] context: "Card numbers and payment details are never sent to the AI service"}ask_ai --> draftingask_ai --> draft_readydrafting ..> ticket : [Cancel]draft_ready --> review : needs review { payload: [reply_draft, refund_amount] }draft_ready --> send_reply : simple, no refund { flags: [experiment] }draft_ready -x-> write_reply : faileddraft_ready -x-> no_draft : timeoutno_draft ..> ticketreview --> submit : [Send] { payload: [reply, refund_amount] }review -x-> write_reply : [Reject]write_reply --> submit : [Send] { payload: [reply, refund_amount] }submit --> send_reply : no refundsubmit --> issue_refund : refund up to $100submit --> lead : over $100lead --> issue_refund : [Approve]lead -x-> write_reply : [Reject]issue_refund --> send_replysend_reply -right-> sent@endujn