Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Workflows overview

Workflows orchestrate multi-step AI logic with named agents, shared state, and optional observability in the DNotifier dashboard. Define agents once, compose them in a Workflow, and execute with runWorkflow.

Run workflows with transport: "http". Each runWorkflow call authenticates via connect() and returns { result, state, executionId? }.

Core concepts

Concept
Description

Agent

Named unit of work β€” classic defineAgent({ name, run }) or tool agent defineAgent({ name, tools, instructions })

Tools / MCP

Local notifier.tools.register or notifier.mcp.connect β€” see Tools & MCP

Workflow

Entry function + registered agents β€” new Workflow({ name, entry })

WorkflowContext

ctx passed to entry and agents β€” AI, search, runAgent / runAgents, shared state

Standalone runAgent

notifier.runAgent(agent, { input }) for tool agents outside a workflow

Middleware

Hooks around agents and workflows β€” logging, tool access, auth β€” see Middleware

Checkpoints

sessionId + resume / retry / replay β€” durable runs across turns and failures β€” see Checkpoints

Observability

observability: true β€” step telemetry in the dashboard

Runner

notifier.runWorkflow({ workflow, input })

Architecture

  runWorkflow({ input })
         β”‚
         β–Ό
  Workflow.entry(ctx)
         β”‚
         β”œβ”€ ctx.runAgent("intent-agent")
         β”œβ”€ ctx.search({ query })
         β”œβ”€ ctx.sendAI({ message })
         └─ ctx.state.sharedKey = value
         β”‚
         β–Ό
  { result, state, executionId }

Three-step integration

  1. Define agents β€” DNotifier.defineAgent / define_agent

  2. Build a workflow β€” new DNotifier.Workflow + registerAgents

  3. Run a workflow β€” runWorkflow after connect()

For tools and MCP, see Tools & MCP agents (local tools, MCP connect, standalone runAgent). For logging, tool guards, and workflow access checks, see Middleware. For multi-turn memory and retry after failure, see Checkpoints, sessions & resume. For agents on other servers, see Remote agents (JavaScript, Python, and Dart). To let Claude, Cursor, or other agents call yours, see Serve agents over MCP and Agent-to-agent (A2A).

When to use workflows

Scenario
Why workflows

Intent routing

Classify β†’ branch to search or chat

RAG pipelines

Search β†’ summarize β†’ answer

Content generation

Draft β†’ edit β†’ SEO (multi-agent)

Tool / MCP assistants

Agent loop with local or MCP tools

Auditable automation

Observability per step

vs single sendAI

Single prompt
Workflow

One model call

Many steps with branching

No shared state object

ctx.state across agents

Manual orchestration in app code

Declarative entry function

AI session logs only

Workflow dashboard + step detail

Examples

Example
Description

Classify β†’ search or general Q&A

Blog: create β†’ edit β†’ SEO

Register a tool and run with runAgent

Public MCP server + diagram assistant

Reference

Next steps

Last updated