Skip to content

Chat & LLM

Dagu can call language models from workflows, let models invoke DAGs as tools, or run external agent CLIs. This section helps choose the right approach; exact chat.completion syntax lives in the LLM action reference.

Choose an Approach

GoalUse
Send prompts or message lists directly to a model providerchat.completion
Let a model call DAG workflows as functionsTool Calling
Run an external coding-agent CLI inside a workflowharness.run
Let an external AI client inspect and operate DaguMCP Server

LLM Completions

Use action: chat.completion for provider API calls, multi-turn sessions, model fallback, reasoning, web search, and response routing.

Agents and Tools

Tool calling turns selected DAGs into functions that a model can invoke during a completion. Use it when the model should choose and sequence workflow operations.

Use harness.run instead when the workflow should launch an external agent such as Claude Code, Codex, Copilot, or OpenCode. Use the MCP server for the inverse relationship: an external AI client connects to Dagu and operates workflows through Dagu's tools and resources.

Released under the MIT License.