# State diagram

> The same editor as a state machine: cycles allowed, custom node bodies through a snippet, and every label localized in Spanish.

Language: en
Canonical: https://texuli.com/examples/workflows-state-machine/
Markdown: https://texuli.com/examples/workflows-state-machine.md (this page). Every texuli.com page has a Markdown twin at its URL plus `.md` (the home page is https://texuli.com/index.md), and any page URL answers `Accept: text/markdown` with its twin instead of HTML.
Last Updated: 2026-11-13

---

[All examples](https://texuli.com/examples/)

The same editor as a state machine: cycles allowed, custom node bodies through a snippet, and every label localized in Spanish.

[State diagram](https://texuli.com/examples/workflows-state-machine/)

`workflows-state-machine` · `workflows/WorkflowEditor`

 workflows graph

 Props
- `graph`
- `labels`
- `messages`
- `node`
- `outline`
- `palette`
- `registry`

Live example loads in an isolated same-origin preview frame.

Source (workflows-state-machine/entry.ts)

```
import { defineExample } from '../registry.ts';

export const workflowsStateMachineExample = defineExample({
  id: 'workflows-state-machine',
  title: 'State diagram',
  description:
    'The same editor as a state machine: cycles allowed, custom node bodies through a snippet, and every label localized in Spanish.',
  tags: ['workflows', 'graph', 'i18n', 'snippet'],
  component: 'workflows/WorkflowEditor',
  props: ['graph', 'registry', 'node', 'labels', 'messages', 'palette', 'outline'],
  load: () => import('./WorkflowsStateMachineDemo.svelte'),
});
```

## For agents

A worked example rendered live in the browser; the isolated preview frame (`/examples/preview/<id>/`) shows the same example without the site shell, and the example page next to it carries its code. The live parts run in the browser and are not in this Markdown; the operations below do the same work through the read-only MCP server at https://texuli.com/mcp (no sign-in; see https://texuli.com/auth.md).

MCP operations ([reference](https://github.com/DailybotHQ/texuli/blob/main/packages/tools/docs/ops.md#operations)):

- `example.search`: Find component examples.
- `component.get`: Read a component manifest.

Docs:

- [Component docs for agents (llms.txt)](https://texuli.com/llms/llms.txt)
- [Catalog manifest snapshot (JSON)](https://texuli.com/catalog/catalog.json)
- [@texuli/examples README](https://github.com/DailybotHQ/texuli/blob/main/packages/examples/README.md)
- [texuli README](https://github.com/DailybotHQ/texuli/blob/main/packages/texuli/README.md)
