# AI agent workflow diagram

> A one-page 1920 × 1080 diagram of an AI agent that reads a refund email, finds the order, checks the policy, decides, writes a reply and logs the case, with the tools used at each step. Each step is one component and each handover is another, so changing a name, a tool or a reason is one line, and the path colours are tokens.

- The design, as a .vd file: https://getv.design/library/ai-agent-workflow-diagram.vd
- Its page: https://getv.design/library/ai-agent-workflow-diagram

## How it was made

Drafted from this prompt:

> A workflow diagram for Parcelly's refund assistant: it reads an email, finds the order, checks the policy, decides, writes a reply or hands to a person, and logs the case. Show tools used at each step and the three places a person takes over.

Then refined:

- Rewrapped the heading onto two even lines.
- Moved the tool lines to the left edge of each step so no label runs into a handover bracket.
- Made the handover tint and brackets shorter and the handover text larger.
- Set the legend titles in bold and moved the legend up from the page edge.

## Make it yours

- "Make an AI agent workflow diagram for my own process."
- "Add a retry loop when the order is not found."
- "Change the handover brackets to say who picks each case up."

## The source

```vd
version 12
kind design
title "AI agent workflow diagram"
$graphite = #1D2026
$paper = #F6F6F2
$green = #34D399
$orange = #F97316
$rust = #C2410C
$muted = #5A606B
$m = 118
$line = 580
$pad = 14
$zoff = 90
$zw = 160
$hop = 56

font display = "Zen Dots"
  fallback "system-ui, sans-serif"
  face asset=zen-dots-400 weight=400

font body = Lusitana
  fallback "Georgia, serif"
  face asset=lusitana-400 weight=400
  face asset=lusitana-700 weight=700

asset zen-dots-400 = font/woff2 hash=sha256-aaad72a24e4047bf39cac4bca3c5de075c83b11476b3b162e2a3939b9fe5fceb bytes=13856 license=OFL
asset lusitana-400 = font/woff2 hash=sha256-8f40676c64a72cb5d80952071b7a2f371650d7b2bb787ea01d8c5bc88ef734c7 bytes=11728 license=OFL
asset lusitana-700 = font/woff2 hash=sha256-ee7ef1d38007c4773d1e000177123fb440383c0d0187fd7d2d6978a0ed0f8976 bytes=11644 license=OFL

frame flow x=0 y=0 w=1920 h=1080 background=paper
  text flow.title x=$m y=72 w=1684 h=116 font=display size=50 lineHeight=1.15 letterSpacing=-1 fill=graphite
    "2,610 of 3,000 refund emails\na week stay on the green line"
  text flow.sub x=$m y=(@flow.title.bottom + 16) w=1300 h=72 font=body size=28 lineHeight=1.3 fill=muted
    "Parcelly's assistant reads, checks and answers. It stops at three points and hands the case to a person."

  instance n1 component=step x=$m y=($line - 60)
    override step.num
      "1"
    override step.label
      "Read\nemail"
  rect seg1 x=@n1.right y=($line - 8) w=$hop h=16 fill=green
  instance n2 component=step x=(@seg1.right) y=@n1.y
    override step.num
      "2"
    override step.label
      "Find\norder"
  rect seg2 x=@n2.right y=($line - 8) w=$pad h=16 fill=green
  instance h1 component=handover x=(@n2.right + $pad - $zoff) y=($line - 240)
    override hand.who
      "Support agent"
    override hand.why
      "Order not found after two tries, about 120 a week."
  rect seg3 x=(@h1.x + $zoff + $zw) y=($line - 8) w=$pad h=16 fill=green
  instance n3 component=step x=(@seg3.right) y=@n1.y
    override step.num
      "3"
    override step.label
      "Check\npolicy"
  rect seg4 x=@n3.right y=($line - 8) w=$pad h=16 fill=green
  instance h2 component=handover x=(@n3.right + $pad - $zoff) y=@h1.y
    override hand.who
      "Policy owner"
    override hand.why
      "No rule fits, about 120 a week."
  rect seg5 x=(@h2.x + $zoff + $zw) y=($line - 8) w=$pad h=16 fill=green
  instance n4 component=step x=(@seg5.right) y=@n1.y
    override step.num
      "4"
    override step.label
      "Decide"
  rect seg6 x=@n4.right y=($line - 8) w=$pad h=16 fill=green
  instance h3 component=handover x=(@n4.right + $pad - $zoff) y=@h1.y
    override hand.who
      "Team lead"
    override hand.why
      "Over £150 or flagged for fraud, about 150 a week."
  rect seg7 x=(@h3.x + $zoff + $zw) y=($line - 8) w=$pad h=16 fill=green
  instance n5 component=step x=(@seg7.right) y=@n1.y
    override step.num
      "5"
    override step.label
      "Write\nreply"
  rect seg8 x=@n5.right y=($line - 8) w=$hop h=16 fill=green
  instance n6 component=step x=(@seg8.right) y=@n1.y
    override step.num
      "6"
    override step.label
      "Log\ncase"

  group tools
    connector tool.1 x1=(@n1.x + 16) y1=@n1.bottom x2=(@n1.x + 16) y2=(@n1.bottom + 104) stroke=graphite strokeWidth=2 end=dot
    ellipse tool.1.a x=(@n1.x + 11) y=(@n1.bottom + 43) w=10 h=10 fill=graphite
    text tool.1.al x=(@n1.x + 32) y=(@n1.bottom + 34) w=140 h=28 valign=middle font=body size=21 fill=graphite
      "inbox.fetch"
    text tool.1.bl x=(@n1.x + 32) y=(@n1.bottom + 90) w=140 h=28 valign=middle font=body size=21 fill=graphite
      "extract_fields"
    connector tool.2 x1=(@n2.x + 16) y1=@n2.bottom x2=(@n2.x + 16) y2=(@n2.bottom + 104) stroke=graphite strokeWidth=2 end=dot
    ellipse tool.2.a x=(@n2.x + 11) y=(@n2.bottom + 43) w=10 h=10 fill=graphite
    text tool.2.al x=(@n2.x + 32) y=(@n2.bottom + 34) w=140 h=28 valign=middle font=body size=21 fill=graphite
      "orders.lookup"
    text tool.2.bl x=(@n2.x + 32) y=(@n2.bottom + 90) w=140 h=28 valign=middle font=body size=21 fill=graphite
      "carrier.track"
    connector tool.3 x1=(@n3.x + 16) y1=@n3.bottom x2=(@n3.x + 16) y2=(@n3.bottom + 104) stroke=graphite strokeWidth=2 end=dot
    ellipse tool.3.a x=(@n3.x + 11) y=(@n3.bottom + 43) w=10 h=10 fill=graphite
    text tool.3.al x=(@n3.x + 32) y=(@n3.bottom + 34) w=140 h=28 valign=middle font=body size=21 fill=graphite
      "policy.search"
    text tool.3.bl x=(@n3.x + 32) y=(@n3.bottom + 90) w=140 h=28 valign=middle font=body size=21 fill=graphite
      "returns.history"
    connector tool.4 x1=(@n4.x + 16) y1=@n4.bottom x2=(@n4.x + 16) y2=(@n4.bottom + 48) stroke=graphite strokeWidth=2 end=dot
    text tool.4.al x=(@n4.x + 32) y=(@n4.bottom + 34) w=140 h=28 valign=middle font=body size=21 fill=graphite
      "refund.limit"
    connector tool.5 x1=(@n5.x + 16) y1=@n5.bottom x2=(@n5.x + 16) y2=(@n5.bottom + 104) stroke=graphite strokeWidth=2 end=dot
    ellipse tool.5.a x=(@n5.x + 11) y=(@n5.bottom + 43) w=10 h=10 fill=graphite
    text tool.5.al x=(@n5.x + 32) y=(@n5.bottom + 34) w=140 h=28 valign=middle font=body size=21 fill=graphite
      "template.fill"
    text tool.5.bl x=(@n5.x + 32) y=(@n5.bottom + 90) w=140 h=28 valign=middle font=body size=21 fill=graphite
      "mail.send"
    connector tool.6 x1=(@n6.x + 16) y1=@n6.bottom x2=(@n6.x + 16) y2=(@n6.bottom + 48) stroke=graphite strokeWidth=2 end=dot
    text tool.6.al x=(@n6.x + 32) y=(@n6.bottom + 34) w=140 h=28 valign=middle font=body size=21 fill=graphite
      "cases.write"

  connector key.rule x1=$m y1=860 x2=(100% - $m) y2=860 stroke=graphite strokeWidth=2
  rect key.green x=$m y=904 w=64 h=16 fill=green
  text key.green.t x=$m y=936 w=520 h=92 font=body size=23 lineHeight=1.3 fill=graphite
    "Default path\n" weight=700
    "2,610 a week finish here with no person involved."
  vector key.hand x=720 y=892 w=64 h=40 view="0 0 64 40" d="M16 3H3V37H16M48 3H61V37H48" fill=none stroke=orange strokeWidth=6
  text key.hand.t x=720 y=936 w=520 h=92 font=body size=23 lineHeight=1.3 fill=graphite
    "A person takes over\n" weight=700
    "390 a week: 120 order not found, 120 no rule fits, 150 over £150 or flagged."
  connector key.tool x1=1322 y1=912 x2=1386 y2=912 stroke=graphite strokeWidth=2 end=dot
  text key.tool.t x=1322 y=936 w=480 h=92 font=body size=23 lineHeight=1.3 fill=graphite
    "Tool call\n" weight=700
    "A named function the agent calls. Each one is logged with the case."

frame step x=0 y=1200 w=168 h=120 component
  rect step.bg x=0 y=0 w=(100%) h=(100%) fill=graphite radius=10
  text step.num x=16 y=10 w=40 h=30 font=body size=22 weight=700 fill=green
    "1"
  text step.label x=0 y=0 w=(100%) h=(100%) align=center valign=middle font=display size=22 lineHeight=1.25 fill=paper
    "Step"

frame handover x=300 y=1200 w=340 h=420 component
  text hand.who x=0 y=0 w=(100%) h=34 align=center font=display size=24 fill=rust
    "Person"
  text hand.why x=0 y=42 w=(100%) h=72 align=center font=body size=23 lineHeight=1.3 fill=graphite
    "Reason"
  rect hand.tint x=90 y=130 w=160 h=220 fill=orange opacity=0.14
  vector hand.left x=90 y=130 w=22 h=220 view="0 0 22 220" d="M22 5H5V215H22" fill=none stroke=orange strokeWidth=10
  vector hand.right x=228 y=130 w=22 h=220 view="0 0 22 220" d="M0 5H17V215H0" fill=none stroke=orange strokeWidth=10
  ellipse hand.head x=153 y=196 w=34 h=34 fill=orange
  vector hand.body x=140 y=238 w=60 h=30 view="0 0 60 30" d="M0 30A30 30 0 0 1 60 30Z" fill=orange
```
