Vilqor

AI Agent Workflow Diagram

AI chats

About

A workflow drawn like a node editor: a trigger, an agent with its tools on dashed lines, outputs with item counts and a pulse along each edge. All data: pass nodes and edges. From the Midnight template.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds AI Agent Workflow Diagram to your project and fits it to your theme.

Code

How AI Agent Workflow Diagram is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import type { CSSProperties } from "react"
import { Bot, Database, FileSpreadsheet, GitBranch, Hash, Mail, MessageSquare, Send, Webhook } from "lucide-react"

import { FlowCanvas, type FlowEdge, type FlowNode } from "@/components/ui/flow-canvas"

// Midnight by day: Fraunces heading, Geist text, Geist Mono labels, the agent in deep gold
const fonts =
  "@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT@0,9..144,300..600,0..100;1,9..144,300..600,0..100&family=Geist:wght@400..600&family=Geist+Mono:wght@400..500&display=swap');"

const settings = {
  label: "Workflows",
  title: "Automate the busywork.",
  grid: true,
  pulse: true,
  background: "#f7f5f0",
  card: "#ffffff",
  text: "#141a2e",
  muted: "#4a5166",
  primary: "#a8803a",
}

function day(s: typeof settings) {
  const t: Record<string, string> = {
    background: s.background,
    foreground: s.text,
    card: s.card,
    primary: s.primary,
    "muted-foreground": s.muted,
  }
  return {
    ...Object.fromEntries(Object.entries(t).flatMap(([k, v]) => [[`--${k}`, v], [`--color-${k}`, v]])),
    "--font-display": "Fraunces, ui-serif, Georgia, serif",
    "--font-sans": "Geist, ui-sans-serif, system-ui, sans-serif",
    "--font-mono": "'Geist Mono', ui-monospace, Menlo, monospace",
  } as CSSProperties
}

const i = { strokeWidth: 1.75 }
const tools = [
  { icon: <GitBranch {...i} />, title: "GitHub" },
  { icon: <Database {...i} />, title: "Postgres" },
  { icon: <FileSpreadsheet {...i} />, title: "Sheets" },
  { icon: <Mail {...i} />, title: "Gmail" },
]
const outputs = [
  { icon: <Hash {...i} />, title: "Post to Slack", subtitle: "#releases", items: "3 messages" },
  { icon: <MessageSquare {...i} />, title: "Reply to issues", subtitle: "GitHub", items: "12 replies" },
  { icon: <Send {...i} />, title: "Send digest", subtitle: "Every Friday", items: "1 email" },
]

const flow = {
  width: 1120,
  height: 312,
  nodes: [
    { id: "trigger", kind: "trigger", x: 0, y: 96, icon: <Webhook {...i} />, title: "Webhook", subtitle: "on new release", done: true },
    { id: "agent", kind: "agent", x: 260, y: 92, w: 280, icon: <Bot {...i} style={{ color: "var(--color-primary)" }} />, title: "Release agent", subtitle: "Summarise · route · reply", done: true },
    ...tools.map((t, n): FlowNode => ({ id: `tool${n}`, kind: "tool", x: 400 + (n - 1.5) * 96 - 24, y: 232, ...t })),
    ...outputs.map((o, n): FlowNode => ({ id: `out${n}`, x: 900, y: 96 + (n - 1) * 96, label: "right", icon: o.icon, title: o.title, subtitle: o.subtitle, done: true })),
  ] as FlowNode[],
  edges: [
    { from: "trigger", to: "agent" },
    ...outputs.map((o, n): FlowEdge => ({ from: "agent", to: `out${n}`, label: o.items })),
    ...tools.map((_, n): FlowEdge => ({ from: "agent", to: `tool${n}`, kind: "tool" })),
  ],
}

export default function Demo(props: Partial<typeof settings>) {
  const s = { ...settings, ...props }
  return (
    <div
      className="flex min-h-svh w-full items-center justify-center overflow-x-clip px-6 py-16"
      style={{ ...day(s), fontFamily: "Geist, ui-sans-serif, system-ui, sans-serif", background: s.background, color: s.text } as CSSProperties}
    >
      <style>{fonts}</style>
      <div className="w-full max-w-[1120px]">
        <p className="flex items-center gap-2 text-[12px] leading-4 tracking-[0.16em] uppercase" style={{ fontFamily: "var(--font-mono)", color: "#8a6a2e" }}>
          <svg viewBox="-6 -6 12 12" className="size-2.5" aria-hidden="true">
            <path d="M0 -6Q0 0 6 0Q0 0 0 6Q0 0 -6 0Q0 0 0 -6Z" fill="currentColor" />
          </svg>
          {s.label}
        </p>
        <h2
          className="mt-5 max-w-[720px] text-[40px] leading-[1.04] font-[350] tracking-[-0.02em] text-balance md:text-[56px]"
          style={{ fontFamily: "var(--font-display)", fontVariationSettings: '"SOFT" 50' }}
        >
          {s.title}
        </h2>
        <p className="mt-3 max-w-[560px] text-[17px] leading-7" style={{ color: s.muted }}>
          One agent watches your releases, reads four tools and hands the results to your team.
        </p>
        <FlowCanvas {...flow} grid={s.grid} pulse={s.pulse} aria-label="A release flow: a webhook starts an agent that reads four tools and sends three outputs" className="mt-14" />
      </div>
    </div>
  )
}

Dependencies

More by Vilqor

View all
  • Card Carousel to Grid

    Card Carousel to Grid

  • AI Email Reply with Tones

    AI Email Reply with Tones

  • AI Memory Timeline

    AI Memory Timeline

  • Use Cases Tabs Section

    Use Cases Tabs Section

  • Pricing Section with Toggle

    Pricing Section with Toggle

  • Logo Cloud Marquee

    Logo Cloud Marquee

  • Testimonials Marquee

    Testimonials Marquee

  • Footer with Big Wordmark

    Footer with Big Wordmark

More in AI chats

View all
  • AI Actions

    AI Actions

    345
  • Aquarium Prompt

    Aquarium Prompt

    72
  • Agent Chat

    Agent Chat

    19
  • Color Picker

    Color Picker

    180
  • Commit

    Commit

    35
  • Illos Knowledge Sources

    Illos Knowledge Sources

    44
  • Chat Bubble

    Chat Bubble

    201
  • System Message

    System Message

    78