> For the complete documentation index, see [llms.txt](https://dnotifier.gitbook.io/product-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/example-multi-agent.md).

# Example: Multi-agent pipeline

A **three-stage blog writing pipeline**: **content creator** → **clarity editor** → **SEO optimizer**. Each stage is a separate agent; the workflow `entry` runs them sequentially with shared `ctx.state`.

## Pipeline

```
  input { topic, keywords, audience, tone, wordCount }
         │
         ▼
  content-creator ──► draft markdown
         │
         ▼
  clarity-editor ──► refined article
         │
         ▼
  seo-optimizer ──► article + metaTitle + metaDescription + slug
```

{% hint style="success" %}
Set **`observability: true`** to see each AI step (draft, edit, SEO) in the workflow dashboard with token usage and latency.
{% endhint %}

## Why sequential agents?

| Benefit                    | Explanation                                                  |
| -------------------------- | ------------------------------------------------------------ |
| **Separation of concerns** | Each agent has one prompt specialty                          |
| **Debuggable**             | Inspect `ctx.state.draft`, `ctx.state.refined` between steps |
| **Observable**             | Three labeled steps in the dashboard                         |
| **Reusable**               | Agents can be recomposed in other workflows                  |

## Language guides

Full self-contained examples:

| Language                | Guide                                                                                                       |
| ----------------------- | ----------------------------------------------------------------------------------------------------------- |
| JavaScript / TypeScript | [javascript-typescript.md](/product-docs/workflows-and-agents/example-multi-agent/javascript-typescript.md) |
| Dart / Flutter          | [dart-flutter.md](/product-docs/workflows-and-agents/example-multi-agent/dart-flutter.md)                   |

## Sample input

```json
{
  "topic": "How to build deterministic AI workflows with DNotifier",
  "keywords": ["workflow", "sdk", "observability"],
  "audience": "software developers",
  "tone": "professional",
  "wordCount": 900
}
```

## Next steps

* [**Workflow observability**](/product-docs/workflows-and-agents/observability.md)
* [**Build a workflow**](/product-docs/workflows-and-agents/build-workflow.md)
