#674 Implemented real-time visibility fields in GET /workflows/{id} endpoint: 1. Added current_step - shows which step is currently executing/sleeping (extracted from payload->>'step_name') 2. Added progress object with completed_steps, total_steps, percentage 3. Added activities_summary with pending/running/completed/failed counts from highway.activity_queue 4. Added last_event with event_type and timestamp Fixed SQL query to extract step_name from JSONB payload field using payload->>'step_name' instead of non-existent column. Tested with parallel activity workflows: - Successfully shows 'sleeping' status with current step (wait_task1, wait_task2, etc.) - Progress correctly shows 4/8 (50%) during execution - Activities summary shows run=3 during execution, done=3 after completion - Final state shows completed with 8/8 (100%) Note: SSE/WebSocket for real-time push updates can be added in a future enhancement.

closed high Created 2025-12-24 21:13 · Updated 2025-12-24 21:26

Description

Edit
Problem: For long-running workflows, users are blind to progress during execution. They have to poll multiple endpoints. Findings from investigation: - Activity workers work correctly for parallel long-running tasks - Rich data IS available in DB but not exposed efficiently Current state: - GET /workflows/{id} shows status but not current_step or progress - GET /workflows/{id}/events shows step-by-step events (separate call needed) - GET /workflows/{id}/activities shows activity status (separate call needed) Proposed additions to GET /workflows/{id}: 1. current_step - which step is currently executing/sleeping 2. progress.completed_steps / total_steps / percentage 3. activities_summary - inline activity status summary 4. last_event - most recent event type and timestamp Also: - Fix activity_name showing as 'activity' instead of task_id - Add activity_started event when activity worker claims task - Consider SSE endpoint for real-time updates

Comments

Loading comments...

Context

Loading context...

Audit History

View All
Loading audit history...