feat(logs): added sub-workflow logs, updated trace spans UI, fix scroll behavior in workflow registry sidebar #1037
Conversation
There was a problem hiding this comment.
Greptile Summary
This PR introduces sub-workflow logging capabilities, allowing nested workflow executions to propagate their trace spans to parent workflows for better observability. The implementation adds three key components:
-
Sub-workflow Log Integration: A new
integrateChildWorkflowLogsmethod in the executor index that processes child workflow trace spans and integrates them into the parent workflow's execution context. This method includes proper type checking to ensure it only processes workflow-type blocks and validates the structure of child trace spans. -
Comprehensive Child Workflow Logging: The
WorkflowBlockHandlernow captures, transforms, and integrates child workflow logs through three new private methods:captureChildWorkflowLogs(),transformSpanForChildWorkflow(), andcleanChildSpanName(). The implementation recursively processes trace spans from nested workflows, adding metadata to identify them as child workflow spans and cleaning up naming conventions for better readability. -
Improved Sidebar UX: The workflow registry sidebar now implements intelligent scroll behavior that distinguishes between newly created workflows (created within 5 seconds) and existing ones. New workflows scroll to the top for visibility, while existing workflow navigation uses minimal scrolling with visibility checks to preserve user context.
The changes support complex workflow compositions where workflows can execute other workflows recursively, as demonstrated by the "workflow-in-workflow-in-workflow" screenshot. The trace span transformation ensures proper hierarchical structure is maintained while providing clear visual distinction between parent and child workflow execution logs.
Confidence score: 4/5
- This PR introduces significant new functionality with proper error handling and type safety, making it relatively safe to merge
- Score reflects well-structured implementation with comprehensive logging integration, though the feature adds complexity to execution flow
- Pay close attention to the sidebar scroll behavior changes and workflow handler modifications as they affect core user experience and execution logic
3 files reviewed, 2 comments
…ll behavior in workflow registry sidebar (#1037) * added sub-workflow logs * indent input/output in trace spans display * better color scheme for workflow logs * scroll behavior in sidebar updated * cleanup * fixed failing tests
…ll behavior in workflow registry sidebar (simstudioai#1037) * added sub-workflow logs * indent input/output in trace spans display * better color scheme for workflow logs * scroll behavior in sidebar updated * cleanup * fixed failing tests
Summary
added sub-workflow logs, updated trace spans UI, fix scroll behavior in workflow registry sidebar
Type of Change
Testing
Tested manually.
Checklist
Screenshots/Videos
Workflow-in-workflow-in-workflow:
