Skip to content

Example: Customer Support Workflow

Document ID: EX-004
File Path: docs/16-examples/customer-support.md
Version: 1.0.0
Status: Draft
Owner: Developer Relations Team
Last Updated: 2026-06-27


Build a multi-step workflow that triages a support request, drafts a reply with a RAG agent, and routes high-value refunds to a human approval before acting — combining agents, tools, branching, and human-in-the-loop.


intake → classify (ai) ──► refund? ──yes──► amount > $100? ──yes──► human approval ──► issue refund (tool)
│ └─no──► issue refund (tool)
└─no──► draft reply (agent) ──► send email (tool)

This uses conditional branching, a human task, and tool + ai activities.


workflows/support.yaml:

apiVersion: workflow.wovyr.io/v1
kind: Workflow
metadata: { name: support-triage, version: 1.0.0 }
spec:
input: { ticketId: string, message: string, customerId: string }
activities:
- id: classify
type: ai
inputs: { prompt: classify_ticket, text: "${input.message}" }
- id: draftReply
type: ai
inputs: { agent: docs-bot, message: "${input.message}" } # the RAG agent
- id: approve
type: human
assignee: support-lead
timeout: 24h
- id: issueRefund
type: tool
inputs: { tool: billing.refund, customerId: "${input.customerId}" }
- id: sendEmail
type: tool
inputs: { tool: email.send, template: reply }
branches:
- when: "classify.intent == 'refund' && input.amount > 100"
goto: approve
- when: "classify.intent == 'refund'"
goto: issueRefund
- when: "classify.intent != 'refund'"
goto: draftReply
compensation:
issueRefund: { compensate: billing.reverseRefund }

The draftReply step reuses the RAG agent; issueRefund declares compensation so a downstream failure can roll back the refund (saga).


Terminal window
wovyr workflows validate -f workflows/support.yaml
wovyr workflows create -f workflows/support.yaml
WF=$(wovyr workflows list -o json | jq -r '.data[]|select(.name=="support-triage").id')
wovyr workflows publish "$WF"
EXE=$(wovyr workflows run "$WF" --input @ticket.json -o json | jq -r '.execution_id')
wovyr workflows executions get "$EXE" --watch

When a refund exceeds $100, the execution suspends on the human task. The support lead approves in the dashboard or via CLI:

Terminal window
TASK=$(wovyr workflows executions get "$EXE" -o json | jq -r '.pending_task_id')
wovyr workflows tasks complete "$TASK" --decision approved

The execution resumes and issues the refund (human tasks).


  • The execution is durable — it survives restarts via checkpointing and can wait 24h for approval without holding resources.
  • If sendEmail fails after a refund, compensation reverses the refund.

Watch the execution animate in the Workflow Builder; inspect per-activity inputs/outputs, retries, and the approval decision.



VersionDateDescription
1.0.02026-06-27Initial Customer Support Workflow example