# Returns swimlane map

> A swimlane diagram of an online return at Hearthwell Home across customer, warehouse, customer service and finance, with a blue branch for damaged items. The boxes are one component and every arrow is a connector bound to them, so moving a step moves its lines.

- The design, as a .vd file: https://getv.design/library/returns-swimlane.vd
- Its page: https://getv.design/library/returns-swimlane

## How it was made

Drafted from this prompt:

> A swimlane diagram for how Hearthwell Home handles an online return. Four lanes: customer, warehouse, customer service, finance. From return request to refund, with a branch for damaged items.

Then refined:

- Rewrote the key so each line sits on one row instead of wrapping into the next.
- Widened the steps and spread the columns so the map fills the page and every label is larger.
- Shortened the decision to Damaged? so it no longer touches the diamond's edges.
- Moved the 6 h stub down the line so it no longer covers the Yes label.
- Shortened the review step's wording to fit its box.

## Make it yours

- "Move the inspection step into the customer service lane."
- "Change the hours to our own averages."
- "Add a lane for the courier."

## The source

```vd
version 12
kind design
title "Returns swimlane map"
$ink = #1e1e1e
$kraft = #c8a27c
$kraftlight = #ecdcc8
$kraftmid = #e1caae
$tape = #2f6fb0
$label = #ffffff
$m = 60
$lt = 190
$lh = 215
$sw = 170
$sh = 100
$x1 = 200
$x2 = 415
$x3 = 630
$x4 = 845
$x5 = 1060
$x6 = 1275
$x7 = 1490
$x8 = 1705

font head = "Kumbh Sans"
  fallback "system-ui, sans-serif"
  face asset=kumbh-sans-600 weight=600
  face asset=kumbh-sans-800 weight=800

font mono = "Space Mono"
  fallback "ui-monospace, monospace"
  face asset=space-mono-400 weight=400
  face asset=space-mono-700 weight=700

asset kumbh-sans-600 = font/woff2 hash=sha256-1c7afce7fb667cb7e7176b17048b4a456c1743a4b518705266232137bc97bcdc bytes=13136 license=OFL
asset kumbh-sans-800 = font/woff2 hash=sha256-a7132ff01159e8ed8b71bc013db3e9fb76852bbd5e0ac9b096a398f28c506712 bytes=13056 license=OFL
asset space-mono-400 = font/woff2 hash=sha256-fb4a81a2d0a893e5c38c394a7e716a1cef0b24610a0af49c96f6d529bd66bf2b bytes=16520 license=OFL
asset space-mono-700 = font/woff2 hash=sha256-2d46bd159b53f55c41167a4f1540a074649464194fd1e416f5b4694a6c0f282c bytes=16724 license=OFL

frame page x=0 y=0 w=1920 h=1080 background=kraftlight
  text title x=$m y=34 w=1250 h=124 font=head size=54 weight=800 lineHeight=1.1 letterSpacing=-1 fill=ink
    "A return takes 131 hours, or 149 when the item arrives damaged"
  rect leg.stub x=1340 y=44 w=96 h=34 fill=label stroke=ink strokeWidth=2 radius=4
  text leg.stub.t x=@leg.stub.x y=@leg.stub.y w=@leg.stub.w h=@leg.stub.h font=mono size=20 weight=700 align=center valign=middle fill=ink
    "3 h"
  text leg.stub.d x=(@leg.stub.right + 20) y=(@leg.stub.y + 1) w=440 h=34 font=head size=22 weight=600 fill=ink
    "Average hours on each hand-off"
  rect leg.blue x=1340 y=104 w=96 h=8 fill=tape
  text leg.blue.d x=(@leg.blue.right + 20) y=(@leg.blue.y - 12) w=440 h=34 font=head size=22 weight=600 fill=ink
    "Blue route: damaged items"
  text leg.vol x=1340 y=138 w=460 h=30 font=mono size=18 fill=ink
    "1,900 returns a month, 228 damaged"

  rect lane.1 x=0 y=$lt w=100% h=$lh fill=kraftlight
  rect lane.2 x=0 y=@lane.1.bottom w=100% h=$lh fill=#e3cdb2
  rect lane.3 x=0 y=@lane.2.bottom w=100% h=$lh fill=kraftlight
  rect lane.4 x=0 y=@lane.3.bottom w=100% h=$lh fill=#e3cdb2
  connector lane.edge1 x1=0 y1=@lane.1.top x2=100% y2=@lane.1.top stroke=ink strokeWidth=2
  connector lane.edge2 x1=0 y1=@lane.2.top x2=100% y2=@lane.2.top stroke=kraft strokeWidth=2
  connector lane.edge3 x1=0 y1=@lane.3.top x2=100% y2=@lane.3.top stroke=kraft strokeWidth=2
  connector lane.edge4 x1=0 y1=@lane.4.top x2=100% y2=@lane.4.top stroke=kraft strokeWidth=2
  connector lane.edge5 x1=0 y1=@lane.4.bottom x2=100% y2=@lane.4.bottom stroke=ink strokeWidth=2

  instance tab.1 component=tab x=0 y=@lane.1.top
    override tab.t
      "Customer"
  instance tab.2 component=tab x=0 y=@lane.2.top
    override tab.t
      "Warehouse"
  instance tab.3 component=tab x=0 y=@lane.3.top
    override tab.t
      "Customer service"
  instance tab.4 component=tab x=0 y=@lane.4.top
    override tab.t
      "Finance"

  instance s1 component=step x=$x1 y=(@lane.1.cy - $sh / 2)
    override step.t
      "Requests a return online"
  instance s2 component=step x=$x2 y=(@lane.3.cy - $sh / 2)
    override step.t
      "Checks policy, emails a label"
  instance s3 component=step x=$x3 y=(@lane.1.cy - $sh / 2)
    override step.t
      "Packs and posts the parcel"
  instance s4 component=step x=$x4 y=(@lane.2.cy - $sh / 2)
    override step.t
      "Scans in and inspects"
  vector dia x=$x5 y=(@lane.2.cy - 70) w=$sw h=140 view="0 0 170 140" d="M85 0 L170 70 L85 140 L0 70 Z" fill=ink
  text dia.t x=@dia.x y=@dia.y w=@dia.w h=@dia.h font=head size=21 weight=600 align=center valign=middle fill=label
    "Damaged?"
  instance s5 component=stepd x=$x6 y=(@lane.3.cy - $sh / 2)
    override stepd.t
      "Reviews the photos"
  instance s6 component=step x=$x7 y=(@lane.2.cy - $sh / 2)
    override step.t
      "Restocks the item"
  instance s7 component=step x=$x7 y=(@lane.4.cy - $sh / 2)
    override step.t
      "Pays the refund to the card"
  instance s8 component=step x=$x8 y=(@lane.1.cy - $sh / 2)
    override step.t
      "Sees the refund arrive"

  connector f1 x1=@s1.cx y1=@s1.bottom x2=@s2.left y2=@s2.cy stroke=ink strokeWidth=3 route=elbow end=arrow
  connector f2 x1=@s2.cx y1=@s2.top x2=@s3.left y2=@s3.cy stroke=ink strokeWidth=3 route=elbow end=arrow
  connector f3 x1=@s3.cx y1=@s3.bottom x2=@s4.left y2=@s4.cy stroke=ink strokeWidth=3 route=elbow end=arrow
  connector f4 x1=@s4.right y1=@s4.cy x2=@dia.left y2=@dia.cy stroke=ink strokeWidth=3 route=elbow end=arrow
  connector f5 x1=@dia.cx y1=@dia.bottom x2=@s5.left y2=@s5.cy stroke=tape strokeWidth=4 route=elbow end=arrow
  connector f6 x1=@dia.right y1=@dia.cy x2=@s6.left y2=@s6.cy stroke=ink strokeWidth=3 route=elbow end=arrow
  connector f7 x1=@s6.cx y1=@s6.bottom x2=@s7.cx y2=@s7.top stroke=ink strokeWidth=3 route=elbow end=arrow
  connector f8 x1=@s5.right y1=@s5.cy x2=@s7.left y2=@s7.cy stroke=tape strokeWidth=4 route=elbow end=arrow
  connector f9 x1=@s7.right y1=@s7.cy x2=@s8.cx y2=@s8.bottom stroke=ink strokeWidth=3 route=elbow end=arrow

  text yes x=(@dia.cx + 14) y=(@dia.bottom + 4) w=60 h=28 font=mono size=22 weight=700 fill=tape
    "Yes"
  text no x=(@dia.right + 16) y=(@dia.cy - 36) w=60 h=28 font=mono size=22 weight=700 fill=ink
    "No"

  instance h1 component=stub x=(@s1.cx - 48) y=(@lane.2.top - 17)
    override stub.t
      "2 h"
  instance h2 component=stub x=(@s2.cx - 48) y=(@lane.3.top - 17)
    override stub.t
      "1 h"
  instance h3 component=stub x=(@s3.cx - 48) y=(@lane.2.top - 17)
    override stub.t
      "72 h"
  instance h4 component=stub x=(@dia.cx - 48) y=(@lane.3.top + 24)
    override stub.t
      "6 h"
  instance h5 component=stub x=(@f8.cx - 48) y=(@lane.4.top - 17)
    override stub.t
      "20 h"
  instance h6 component=stub x=(@s6.cx - 48) y=(@lane.3.top - 17)
    override stub.t
      "8 h"
  instance h7 component=stub x=(@s8.cx - 48) y=(@lane.4.top - 17)
    override stub.t
      "48 h"

frame step x=0 y=1200 w=170 h=100 background=#00000000 component
  rect step.r x=0 y=0 w=100% h=100% fill=label stroke=ink strokeWidth=2 radius=6
  text step.t x=12 y=0 w=146 h=100 font=head size=22 weight=600 lineHeight=1.15 align=center valign=middle fill=ink
    "Step"

frame stepd x=300 y=1200 w=170 h=100 background=#00000000 component
  rect stepd.r x=0 y=0 w=100% h=100% fill=tape radius=6
  text stepd.t x=12 y=0 w=146 h=100 font=head size=22 weight=600 lineHeight=1.15 align=center valign=middle fill=label
    "Step"

frame stub x=600 y=1200 w=96 h=34 background=#00000000 component
  rect stub.r x=0 y=0 w=100% h=100% fill=label stroke=ink strokeWidth=2 radius=4
  text stub.t x=0 y=0 w=100% h=100% font=mono size=20 weight=700 align=center valign=middle fill=ink
    "0 h"

frame tab x=800 y=1200 w=150 h=215 background=tape component
  text tab.t x=18 y=0 w=114 h=215 font=mono size=20 weight=700 lineHeight=1.2 valign=middle fill=label
    "Lane"
```
