Build a workflow
A workflow ties agents together with an entry function that orchestrates ctx.runAgent, branching, and shared ctx.state.
Workflow constructor
const workflow = new DNotifier.Workflow({
name: "my-workflow", // required β dashboard id
description: "Short summary", // optional β max 100 chars
observability: true, // optional β dashboard steps
middleware: [], // optional β see Middleware
async entry(ctx) {
// orchestration logic
return { done: true };
},
});Optional middleware runs around entry (auth, logging, metrics). See Middleware.
Register agents
workflow.registerAgents({
"intent-agent": intentAgent,
"general-agent": generalAgent,
});
// Or one at a time:
workflow.registerAgent("intent-agent", intentAgent);In JavaScript, Python, and Dart you can also register a remote agent by receiver id (the host notifierβs userId). See Remote agents.
Entry function patterns
Sequential pipeline
Branching
Parallel (manual)
Validation
Field
Rule
name
Required non-empty string
entry
Required function
description
Optional string, max 100 characters
Agent name on register
Must match defineAgent name
Language guides
Language
Guide
JavaScript / TypeScript
Dart / Flutter
Next steps
Last updated