---
title: "Retrieve chat messages for a step"
method: GET
path: "/dag-runs/{name}/{dagRunId}/steps/{stepName}/messages"
tags: ["dag-runs"]
---

# Retrieve chat messages for a step

`GET /dag-runs/{name}/{dagRunId}/steps/{stepName}/messages`

Fetches the LLM chat message history for a chat step. Returns empty array for non-chat steps.

## Path parameters

- `name` string, regex, required — Name of the DAG
- `dagRunId` string, required — Unique identifier for the DAG-run. The special value 'latest' can be used to reference the most recent DAG-run.
- `stepName` string, required

## Query parameters

- `remoteNode` string

## Response `200`

Chat messages retrieved successfully

- ChatMessagesResponse — Response containing chat messages for a step
  - `messages` ChatMessage[], required — List of chat messages
    - `role` 'system' | 'user' | 'assistant' | 'tool', required — Message role in the session
    - `content` string, required — Message content
    - `toolCalls` ChatToolCall[] — Tool calls made by the assistant (only for assistant messages)
      - `id` string, required — Unique identifier for this tool call
      - `name` string, required — Name of the tool being called
      - `arguments` string — JSON string of tool arguments
    - `metadata` ChatMessageMetadata — Metadata about an LLM API call
      - `provider` string — LLM provider (openai, anthropic, gemini, etc.)
      - `model` string — Model identifier used
      - `promptTokens` integer — Number of tokens in the prompt
      - `completionTokens` integer — Number of tokens in the completion
      - `totalTokens` integer — Total tokens (prompt + completion)
  - `toolDefinitions` ToolDefinition[] — Tool definitions that were available to the LLM
    - `name` string, required — Name of the tool
    - `description` string — Description of what the tool does
    - `parameters` object — JSON Schema describing the tool's parameters
  - `stepStatus` 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9, required — Numeric status code indicating current node state: 0: "Not started" 1: "Running" 2: "Failed" 3: "Aborted" 4: "Success" 5: "Skipped" 6: "Partial Success" 7: "Waiting for approval" 8: "Rejected" 9: "Retrying"
  - `stepStatusLabel` 'not_started' | 'running' | 'failed' | 'aborted' | 'succeeded' | 'skipped' | 'partially_succeeded' | 'waiting' | 'rejected' | 'retrying', required — Human-readable status description for the node
  - `hasMore` boolean, required — True if step is still running and more messages may arrive

## Other responses

- `404` — DAG-run or step not found
- `default` — Generic error response

## Changes

- **2026-05-24** (v1) `8a2d5d3e9608` — 2 warning
  - added the new `rate_limited` enum value to the `code` response property for the response status `404`
  - added the new `rate_limited` enum value to the `code` response property for the response status `default`
- **2026-04-30** (v1) `50e1d517afc1` — 2 info
  - removed the `rate_limited` enum value from the `code` response property for the response status `404`
  - removed the `rate_limited` enum value from the `code` response property for the response status `default`

[Change history](https://skmtc.dev/dagucloud/apis/dagu/changes/dag-runs/:name/:dagRunId/steps/:stepName/messages/get.md)

---

[API](https://skmtc.dev/dagucloud/apis/dagu.md) · [All operations](https://skmtc.dev/dagucloud/apis/dagu/llms.txt) · [OpenAPI document](https://skmtc.dev/dagucloud/apis/dagu/revisions/c5b8d495669e?raw)
