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

# Observability FAQ

Answers to common questions about **AI observability**, **session logs**, and **AI message history** in DNotifier. Use this page to find the right flag (`observability`, `logs`, `saveHistory`) quickly.

***

## How do I do AI observability?

Enable **workflow observability** so multi-agent runs appear in **Dashboard → Workflows**:

1. Set **`observability: true`** on your `Workflow`
2. Use **`transport: "http"`** and `await connect()`
3. Call `runWorkflow` — read `executionId` from the result
4. Open that execution in the dashboard

```js
const workflow = new DNotifier.Workflow({
  name: "my-pipeline",
  observability: true,
  async entry(ctx) {
    return ctx.runAgent("drafter");
  },
});

const run = await notifier.runWorkflow({ workflow, input: "..." });
console.log(run.executionId);
```

→ Step-by-step: [How to enable AI workflow observability](https://dnotifier.gitbook.io/product-docs/observability/ai-workflow-observability.md)

***

## How do I enable logs?

Pass **`logs: true`** when you construct `DNotifier`:

```js
const notifier = new DNotifier({
  appId: process.env.DNOTIFIER_APP_ID,
  secret: process.env.DNOTIFIER_SECRET,
  transport: "http",
  userId: "user-123",
  logs: true,
});
```

Every subsequent `sendAI` records session start/complete (and model / tokens when available) under **Dashboard → Logs**.

You cannot toggle logging per `sendAI` call — it is constructor-level only.

→ Guide: [How to enable session logs](https://dnotifier.gitbook.io/product-docs/observability/enable-session-logs.md)

***

## How do I save AI message history?

On each `sendAI`, set **`saveHistory: true`** (this is the **default**):

```js
await notifier.sendAI({
  senderId: "user-123",
  message: { text: "Hello" },
  saveHistory: true,
});

const history = await notifier.fetchAIHistory({ senderId: "user-123" });
```

Set `saveHistory: false` for internal/ephemeral prompts (for example intent classification inside a workflow).

→ Guide: [How to save AI message history](https://dnotifier.gitbook.io/product-docs/observability/save-ai-message-history.md)

***

## What is the difference between logs, saveHistory, and observability?

| Setting               | Purpose                        | Where to look           |
| --------------------- | ------------------------------ | ----------------------- |
| `logs: true`          | Ops telemetry for AI sessions  | Dashboard **Logs**      |
| `saveHistory: true`   | Persist turns for your product | `fetchAIHistory`        |
| `observability: true` | Trace workflow / agent steps   | Dashboard **Workflows** |

They are independent. Production AI products typically enable **all three**.

→ Overview: [Observability overview](https://dnotifier.gitbook.io/product-docs/observability/observability.md)

***

## Why is my workflow not showing in the dashboard?

Usually **`observability` is false** (or omitted). With observability off, the SDK never registers the workflow or creates an execution.

Also check:

* You called `await notifier.connect()` before `runWorkflow`
* You are looking under **Workflows**, not **Logs**
* The workflow `name` matches what you expect

→ [AI workflow observability](https://dnotifier.gitbook.io/product-docs/observability/ai-workflow-observability.md)

***

## Why are Logs empty after sendAI?

`logs` defaults to **false**. Set `logs: true` on the constructor, reconnect, and call `sendAI` again.

Also confirm you are viewing **Logs** for the same app (`appId`) you authenticated with.

→ [Enable session logs](https://dnotifier.gitbook.io/product-docs/observability/enable-session-logs.md)

***

## Does observability include provider and model?

Yes. On `ctx.sendAI` steps, observability records:

1. `provider` / `model` from the call, else
2. Agent defaults from `defineAgent({ provider, model })`, else
3. For **model**, the project default from auth (`current_model`)

Session logs (`logs: true`) also store the effective **model** the same way.

→ [Send a prompt — provider / model](https://dnotifier.gitbook.io/product-docs/ai/send-prompt.md)

***

## Should workflow internal sendAI calls use saveHistory?

Usually **`saveHistory: false`** for routing/classification steps, and **`true`** for the user-visible assistant reply. That keeps `fetchAIHistory` clean for your UI while observability still records the internal steps when `observability: true`.

***

## Can I use logs and observability together?

Yes. Recommended for production:

```js
logs: true,                 // DNotifier
observability: true,        // Workflow
saveHistory: true,          // user-facing sendAI
```

***

## Is AI history the same as chat history?

No.

* **AI history** — turns from `sendAI` (`saveHistory`)
* **Chat history** — realtime user-to-user messages (`send` + `fetchChatHistory`)

→ [AI history](https://dnotifier.gitbook.io/product-docs/ai/ai-history.md) · [Chat history](https://dnotifier.gitbook.io/product-docs/chat/chat-history.md)

***

## Related guides

* [Observability overview](https://dnotifier.gitbook.io/product-docs/observability/observability.md)
* [Dashboard overview](https://dnotifier.gitbook.io/product-docs/getting-started/dashboard-overview.md)
* [Operations FAQ](https://dnotifier.gitbook.io/product-docs/operations/faq.md)
* [Workflows overview](https://dnotifier.gitbook.io/product-docs/workflows-and-agents/overview.md)
