> 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/observability.md).

# Workflow observability

Set **`observability: true`** on a `Workflow` to send execution telemetry to the DNotifier dashboard — agent runs, AI calls, search, documents, and custom steps.

{% hint style="info" %}
**Full guide:** [How to enable AI workflow observability](/product-docs/observability/ai-workflow-observability.md) · Compare with `logs` and `saveHistory` in [Observability overview](/product-docs/observability/observability.md) · [FAQ](/product-docs/observability/faq.md)
{% endhint %}

## Enable observability

```js
const workflow = new DNotifier.Workflow({
  name: "support-router",
  description: "Route support questions",
  observability: true,
  async entry(ctx) {
    // ...
  },
});
```

Requirements:

1. `observability: true` on the workflow
2. `await notifier.connect()` before `runWorkflow`
3. HTTP transport (recommended)

No extra API keys beyond your app credentials.

{% hint style="warning" %}
If `observability` is off, the workflow **will not appear** in the dashboard and `executionId` will be missing from the run result.
{% endhint %}

## What you see in the dashboard

| What you call                    | What appears                                                                                 |
| -------------------------------- | -------------------------------------------------------------------------------------------- |
| Workflow start / finish          | Execution with status and duration                                                           |
| `ctx.runAgent` / `ctx.runAgents` | Agent steps                                                                                  |
| `ctx.sendAI`                     | AI steps (latency, optional token usage, `provider` / `model` when set on the call or agent) |
| `ctx.search` / document methods  | Search and document steps                                                                    |
| `ctx.recordStep`                 | Custom labeled steps                                                                         |

Open the **Workflows** section in the dashboard — see [Dashboard overview](/product-docs/getting-started/dashboard-overview.md).

## `runWorkflow` return value

```js
const run = await notifier.runWorkflow({ workflow, input: "Hello" });

console.log(run.result);       // return value of entry()
console.log(run.state);        // final ctx.state
console.log(run.executionId);  // present when observability: true
```

Use `executionId` to find the same run in the dashboard.

## Custom steps

```js
await ctx.recordStep({
  label: "Validated user input",
  input: { userId },
  output: { valid: true },
  status: "ok",
});
```

## Labels on SDK calls

```js
await ctx.sendAI({
  message: { text: "Classify intent" },
  saveHistory: false,
  label: "Intent classification",
});

await ctx.search({
  query: "refund policy",
  limit: 5,
  label: "Knowledge search",
});
```

## AI session logging vs workflow observability vs history

| Feature                    | Enable with                         | Dashboard / API  |
| -------------------------- | ----------------------------------- | ---------------- |
| **AI session logging**     | `logs: true` on `DNotifier`         | Logs             |
| **Workflow observability** | `observability: true` on `Workflow` | Workflows        |
| **AI message history**     | `saveHistory: true` on `sendAI`     | `fetchAIHistory` |

You can (and usually should) use **all three** in production.

→ [Observability overview](/product-docs/observability/observability.md)

## Next steps

* [**AI workflow observability (full guide)**](/product-docs/observability/ai-workflow-observability.md)
* [**Observability FAQ**](/product-docs/observability/faq.md)
* [**Parallel agents & shared state**](/product-docs/workflows-and-agents/step-graph.md)
* [**WorkflowContext reference**](/product-docs/workflows-and-agents/workflow-context.md)
* [**Run a workflow**](/product-docs/workflows-and-agents/run-workflow.md)
