# Workflow steps

> An automation or email sequence as connected steps: trigger, AI step, email, wait and condition, each with its detail and result.

- Kind: ui · Category: Data display · Interactivity: none
- Install: `npx shadcn@latest add @haze/workflow-steps`
- File: `src/components/haze/ui/workflow-steps.astro`
- npm dependencies: @lucide/astro
- Registry dependencies: @haze/utils
- Docs page: https://hazeui.com/ui/workflow-steps

## Use when
- An AI agent or automation shows what it does, step by step
- A cold-email or onboarding sequence lists its emails and waits

## Avoid when
- A person fills in a form across several screens. Use stepper.
- The entries are past events. Use timeline.

## Alternatives
- [stepper](https://hazeui.com/ui/stepper.md)
- [timeline](https://hazeui.com/ui/timeline.md)
- [check-runs](https://hazeui.com/ui/check-runs.md)

## Props

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| label | `string` | "Follow-up sequence" | no | Accessible name of the list. |
| steps | `{ kind: "trigger" \| "email" \| "ai" \| "condition" \| "wait"; title: string; detail?: string; stat?: string; href?: string }[]` |  | no | Steps in order. |
| kindLabels | `Partial<Record<Kind, string>>` |  | no | Words for each kind of step, for translation. |
| class | `string` |  | no | Additional classes on the list. |

## Accessibility
- The steps are an ordered list, and each step's kind is written above its title, not only shown by its icon.
- A step with a link opens as one card; waits are plain text between the cards.
- Key Tab: Move between linked steps.

## Agent prompts

### Install and use

Install the Haze UI component "Workflow steps" with `npx shadcn@latest add @haze/workflow-steps`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import WorkflowSteps from "@/components/haze/ui/workflow-steps.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/ui/workflow-steps.md

### Customize with real content

Adapt the Haze workflow-steps ui for our product. Replace the demo values of these props with our real content: label, steps, kindLabels, class. Keep the layout, the heading level rules and these accessibility details: The steps are an ordered list, and each step's kind is written above its title, not only shown by its icon. A step with a link opens as one card; waits are plain text between the cards. Do not add raw color classes; use the Haze tokens.

### Choose the right block

Before using workflow-steps, check it fits: use it when an ai agent or automation shows what it does, step by step; a cold-email or onboarding sequence lists its emails and waits. Avoid it when a person fills in a form across several screens. use stepper.; the entries are past events. use timeline.. Alternatives: @haze/stepper, @haze/timeline, @haze/check-runs.

## Example requests that should lead here
- Show a cold-email sequence: trigger, AI first line, intro email, wait three days, follow-up if no reply.

## Source

```astro
---
import { Bot, Clock, Mail, Split, Zap } from "@lucide/astro";
import { cn } from "../../../lib/haze/utils";

type Kind = "trigger" | "email" | "ai" | "condition" | "wait";

interface Step {
  kind: Kind;
  title: string;
  /** One line of detail: the subject, the prompt, the rule. Ignored for a wait. */
  detail?: string;
  /** Short result after the detail, such as "62% opened". */
  stat?: string;
  href?: string;
}

interface Props {
  /** Accessible name of the list. */
  label?: string;
  steps?: Step[];
  /** Words for each kind of step, read before its title. */
  kindLabels?: Partial<Record<Kind, string>>;
  class?: string;
}

const {
  label = "Follow-up sequence",
  steps = [
    { kind: "trigger", title: "Lead added to the Dental clinics list", detail: "Runs once per lead" },
    { kind: "ai", title: "Write the first line", detail: "From the clinic's website and reviews" },
    { kind: "email", title: "Intro email", detail: "Subject: Fewer missed appointments at {company}", stat: "62% opened", href: "#step-2" },
    { kind: "wait", title: "Wait 3 working days" },
    { kind: "condition", title: "If there is no reply", detail: "Otherwise stop and move the lead to Replied" },
    { kind: "email", title: "Short follow-up", detail: "Subject: Re: Fewer missed appointments", stat: "18% replied", href: "#step-4" },
  ],
  kindLabels = {},
  class: className,
} = Astro.props;

const labels: Record<Kind, string> = { trigger: "Trigger", email: "Email", ai: "AI step", condition: "Condition", wait: "Wait", ...kindLabels };
const icons = { trigger: Zap, email: Mail, ai: Bot, condition: Split, wait: Clock };
const chips: Record<Kind, string> = {
  trigger: "bg-warning/14 text-warning",
  email: "bg-accent text-foreground",
  ai: "bg-success/14 text-success",
  condition: "bg-muted text-foreground inset-ring inset-ring-frame",
  wait: "bg-muted text-muted-foreground inset-ring inset-ring-frame",
};
---

<ol aria-label={label} class={cn("flex flex-col", className)}>
  {
    steps.map((step, i) => {
      const Icon = icons[step.kind];
      const last = i === steps.length - 1;
      const body = (
        <>
          <span class="flex flex-wrap items-baseline gap-x-2">
            <span class="text-xs/4 font-medium text-muted-foreground">{labels[step.kind]}</span>
            {step.stat && <span class="text-[0.8125rem]/5 text-muted-foreground tabular-nums">{step.stat}</span>}
          </span>
          <span class="mt-0.5 block text-[0.8125rem]/5 font-medium text-foreground">{step.title}</span>
          {step.detail && <span class="mt-0.5 block text-[0.8125rem]/5 break-words text-muted-foreground">{step.detail}</span>}
        </>
      );
      return (
        <li class="relative flex gap-3">
          {!last && <span aria-hidden="true" class="absolute top-9 bottom-0 left-[1.0625rem] w-px bg-border" />}
          <span aria-hidden="true" class={cn("relative flex size-9 shrink-0 items-center justify-center rounded-lg", chips[step.kind])}>
            <Icon class="size-4" />
          </span>
          <div class={cn("min-w-0 flex-1", last ? "pb-0" : "pb-4")}>
            {step.kind === "wait" ? (
              <p class="flex h-9 items-center text-[0.8125rem]/5 text-muted-foreground">
                <span class="sr-only">{labels.wait}: </span>
                {step.title}
              </p>
            ) : step.href ? (
              <a
                href={step.href}
                class="block rounded-xl border border-border bg-card px-3.5 py-3 transition-[border-color,translate,box-shadow] duration-200 ease-snappy hover:-translate-y-0.5 hover:border-border-strong hover:shadow-lift focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring"
              >
                {body}
              </a>
            ) : (
              <div class="rounded-xl border border-border bg-card px-3.5 py-3">{body}</div>
            )}
          </div>
        </li>
      );
    })
  }
</ol>
```
