Skip to content

feat(workflow): add node-level execution logs for workflow debugging#6445

Open
stakeswky wants to merge 2 commits intolabring:mainfrom
stakeswky:feat/workflow-node-logs
Open

feat(workflow): add node-level execution logs for workflow debugging#6445
stakeswky wants to merge 2 commits intolabring:mainfrom
stakeswky:feat/workflow-node-logs

Conversation

@stakeswky
Copy link
Contributor

What does this PR do?

Implements the Workflow Node Logs feature from the project roadmap — each workflow node now records structured execution logs (start, params, dispatch, finish, error) that are visible in both the chat response detail modal and the workflow debug panel.

Changes

Backend (packages/service, packages/global)

  • NodeLogItemType: New type with time, level (debug/info/warn/error), message, and optional data
  • Workflow dispatcher instrumentation: Logs emitted at key lifecycle points:
    • Node execution started (name, type)
    • Params resolved (keys)
    • Dispatch callback matched (catch error, edge count)
    • Node execution finished (duration, error status)
    • Error responses
  • nodeLogsMap on workflow runner class with pushNodeLog() helper
  • Logs attached to DispatchNodeResponseType and debug mode responses

Frontend (projects/app)

  • WholeResponseModal: Renders node logs with color-coded levels, timestamps, and expandable data
  • NodeDebugResponse: Shows node logs in the debug panel during step-by-step debugging
  • workflowDebugContext: Passes nodeLogs through to debugResult

Types & Schema

  • nodeLogs added to DispatchNodeResponseType
  • nodeLogs added to FlowNodeItemType.debugResult zod schema
  • nodeLogs added to WorkflowDebugResponse type

i18n

  • Added keys for zh-CN, en, zh-Hant

Screenshots

Node logs appear in the response detail panel with color-coded log levels:

  • 🔵 info — lifecycle events (start/finish)
  • debug — params, dispatch details
  • 🟠 warn — error responses
  • 🔴 error — failures

Testing

  • Lint and format checks pass (lint-staged)
  • Type definitions are consistent across backend and frontend
  • Logs are non-intrusive: only added to response payload, no impact on workflow execution logic

- Add NodeLogItemType (time/level/message/data) to runtime types
- Instrument workflow dispatcher with lifecycle logs:
  - Node start (name, type)
  - Params resolved (keys)
  - Dispatch callback (catch error, edge count)
  - Execution finished (duration, error status)
  - Error responses
- Attach nodeLogs to DispatchNodeResponseType and debug responses
- Add nodeLogs to FlowNodeItemType debugResult schema
- Render node logs in WholeResponseModal (chat response detail)
- Render node logs in NodeDebugResponse (workflow debug panel)
- Pass nodeLogs through workflowDebugContext
- Add i18n keys for zh-CN, en, zh-Hant

Closes: workflow node log feature from README roadmap
@github-actions
Copy link

github-actions bot commented Feb 17, 2026

Preview sandbox Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_sandbox_96d96142627ae67895cb2367fed1467ee6f9eb20

@github-actions
Copy link

github-actions bot commented Feb 17, 2026

Preview mcp_server Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_mcp_server_96d96142627ae67895cb2367fed1467ee6f9eb20

z.record() requires both key and value type args in Zod v4.
@github-actions
Copy link

Preview fastgpt Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_96d96142627ae67895cb2367fed1467ee6f9eb20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant