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

Run a workflow

Execute a registered workflow with runWorkflow after connect() on an HTTP-configured DNotifier instance.

Method

runWorkflow({
  workflow: Workflow,
  input: *,
  senderId?: string,   // defaults to notifier.userId
  sessionId?: string,  // continue workflow state / memory
  mode?: "run" | "resume" | "retry" | "replay",
  fromCheckpointId?: string,
})

Return value

Field
Description

result

Return value of the workflow entry function

state

Final ctx.state object after execution

executionId

Present when observability: true — dashboard correlation id

sessionId

Present when a session was passed or minted

checkpointId

Latest checkpoint when session/checkpointing is on

→ Checkpoints, sessions & resume

Minimal run

Use transport: "http". The runner uses the authenticated notifier for all ctx.sendAI and ctx.search calls inside the workflow.

Input types

input can be any JSON-serializable value:

Type
Example use

string

User question for intent router

object

Blog brief { topic, keywords, audience }

array

Batch items (process in entry)

Error handling

Uncaught errors in entry or agent run propagate from runWorkflow. Use try/catch at the call site:

Language guides

Language
Guide

JavaScript / TypeScript

Dart / Flutter

Next steps

Last updated