feat(platform): per-node execution status on the workflow canvas#1868
Conversation
Fix the step-journal shard routing first: getExecutionStepJournal read only components.workflow while executions are sharded across four component instances, so ~75% of journals appeared empty. Journal loads now resolve the component from the execution's shardIndex (falling back to the start-time id hash for older rows). On top of the fixed journal, a new getExecutionStepStatuses query derives a compact per-node status map (running / success / failed / waiting / canceled, attempts, timing, error, 8KB-capped output preview) server-side. The viewed run lives in the 'execution' URL param: the test panel writes it after starting a run, an ExecutionStatusProvider fans the reactive result out to the canvas nodes via context (not node.data, which loops ReactFlow's StoreUpdater), and each node renders a status badge with a details popover plus a dismissable viewing-run banner. The same query is the seam for the test-panel error feedback (#1484) and step debugging (#1490).
|
Warning Review limit reached
More reviews will be available in 11 minutes and 39 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (24)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…tion Two fixes to e2e/specs/automation.spec.ts: - Scope the completion assertion to the tester side panel (role=complementary, labelled "Test automation"). After PRs #1868/#1870 the canvas now renders a "viewing run" role=status banner whose "Completed" label collides with the tester result's, making a bare getByRole('status') a strict-mode violation (2 elements). The banner lives on the canvas, outside the panel, so the complementary scope is unambiguous. - Make reaching the editor idempotent across retries. The first attempt installs the `test` template, which removes it from the "From template" picker; a retry that still went through the install flow hung on a missing button. Now: if `test` is already installed, open its list row directly; otherwise install via template. Wait for the table to settle (row or empty state) before the branch so a mid-load read can't wrongly pick install.
Closes #1487
What / why
Workflow canvas nodes had no execution awareness — the only runtime feedback was the Executions table. This PR adds live per-node status to the canvas, driven by a single reactive Convex query, and fixes the journal bug that blocked it:
getExecutionStepJournalloaded journals only fromcomponents.workflow, while executions are sharded across 4 component instances (workflow,workflow_1..3) bygetShardIndex(executionId). For shards 1–3 the load threw, was silently swallowed, and the journal rendered empty — ~75% of runs. Loads now resolve the component via the execution's persistedshardIndex(falling back to the same start-time id hash for rows that predate the field), and the catch logs every miss (convex/workflows/executions/get_workflow_component.ts).getExecutionStepStatuses(shared seam for Bug: No Clear Error Feedback in Test Panel #1484/Improvement: Add Step-by-Step Debug Mode #1490). NewqueryWithRLSquery deriving a compact per-node map from the journal + execution row, server-side:running / success / failed / waiting / canceled, attempts (loop iterations), timing, error (incl.recordBodyStepFailureentries and success results routed through theerrorport), and a JSON output preview fromsteps.<slug>.outputcapped at 8KB/node (outputTruncated/outputUnavailablefor storage-offloaded variables). Takesv.string()+normalizeIdinstead ofv.idbecause the id arrives from a user-editable URL param — malformed ids resolve tonullinstead of throwing at the subscription.executionURL param (separate definitions object, so closing a side panel doesn't drop it; survives reload / deep links). The test panel writes it afterExecute;ExecutionStatusProvidersubscribes once and fans the result out to node components via context — notnode.data, which retriggers ReactFlow's StoreUpdater (same rationale asAutomationCallbacksProvider).JsonVieweroutput preview. A dismissable "Viewing run" banner (stacked with the active-triggers banner) names the run and clears the badges.automations.steps.execution.*in en/de/fr) and docs (docs/{en,de,fr}/platform/automations/workflows.md).Note: nested-loop body steps show the latest iteration's status (latest journal entry per slug wins), with an attempts counter in the popover.
Decision-gate recommendations baked in
?execution=deep link); no auto-follow of trigger/schedule runs. Auto-follow stays a possible fast-follow.waitingamber state included — a running execution withwaitingForset marks the current node as waiting (human input / approval pauses), and the banner shows "Waiting for input".getExecutionStepStatuses— Bug: No Clear Error Feedback in Test Panel #1484 and Improvement: Add Step-by-Step Debug Mode #1490 build on it.Verification
Performed:
bun run checkat repo root (format, lint, typecheck, all tests) — green.bun run --filter @tale/platform test:ui— 282 files / 2206 tests green (not part of the roottesttask).get_workflow_component.test.ts(shard resolution),get_execution_step_journal.test.ts(shard-routed load),get_execution_step_statuses.test.ts(14 derivation cases incl. body failures, error port, waiting, truncation, storage offload),automation-step.test.tsx(badge states, popover, card click, a11y),automation-tester.test.tsx(URL-param mirroring).bun run --filter @tale/docs lint+test(locale parity) — green.Not performed (needs a running stack):
Manual verification required
Pre-PR checklist
bun run check(format, lint, typecheck, all tests).h-[…]on skeletons — N/A (no loading states added).services/platform/messages/{en,de,fr}.json./docs/{en,de,fr}/for every user-visible change.bun run --filter @tale/docs lintandbun run --filter @tale/docs test.README.md/README.de.md/README.fr.md— N/A.