  Generalizing the polynomial web category, we introduce a diagrammatic
$\Bbbk$-linear monoidal category, the affine web category, for any commutative
ring $\Bbbk$. Integral bases consisting of elementary diagrams are obtained for
the affine web category and its cyclotomic quotient categories. Connections
between cyclotomic web categories and finite $W$-algebras are established,
leading to a diagrammatic presentation of idempotent subalgebras of $W$-Schur
algebras introduced by Brundan-Kleshchev. The affine web category will be used
as a basic building block of another $\Bbbk$-linear monoidal category, the
affine Schur category, formulated in a sequel.
