Skip to content

feat(platform): per-node execution status on the workflow canvas#1868

Merged
yannickmonney merged 1 commit into
mainfrom
feat/workflow-node-execution-status
Jun 11, 2026
Merged

feat(platform): per-node execution status on the workflow canvas#1868
yannickmonney merged 1 commit into
mainfrom
feat/workflow-node-execution-status

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

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:

  1. Bug fix — journal shard routing. getExecutionStepJournal loaded journals only from components.workflow, while executions are sharded across 4 component instances (workflow, workflow_1..3) by getShardIndex(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 persisted shardIndex (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).
  2. getExecutionStepStatuses (shared seam for Bug: No Clear Error Feedback in Test Panel #1484/Improvement: Add Step-by-Step Debug Mode #1490). New queryWithRLS query deriving a compact per-node map from the journal + execution row, server-side: running / success / failed / waiting / canceled, attempts (loop iterations), timing, error (incl. recordBodyStepFailure entries and success results routed through the error port), and a JSON output preview from steps.<slug>.output capped at 8KB/node (outputTruncated / outputUnavailable for storage-offloaded variables). Takes v.string() + normalizeId instead of v.id because the id arrives from a user-editable URL param — malformed ids resolve to null instead of throwing at the subscription.
  3. URL-state + context threading. The viewed run lives in a new execution URL param (separate definitions object, so closing a side panel doesn't drop it; survives reload / deep links). The test panel writes it after Execute; ExecutionStatusProvider subscribes once and fans the result out to node components via context — not node.data, which retriggers ReactFlow's StoreUpdater (same rationale as AutomationCallbacksProvider).
  4. Canvas UI. Status badge on each step card (and loop container) with ring tint on running/failed/waiting; click opens a popover with status, duration, attempts, loop progress, error, and a JsonViewer output preview. A dismissable "Viewing run" banner (stacked with the active-triggers banner) names the run and clears the badges.
  5. i18n (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

  • Explicit selection only — badges follow the tester-started run (or an ?execution= deep link); no auto-follow of trigger/schedule runs. Auto-follow stays a possible fast-follow.
  • waiting amber state included — a running execution with waitingFor set marks the current node as waiting (human input / approval pauses), and the banner shows "Waiting for input".
  • 8KB per-node output preview cap — derivation + truncation happen server-side to keep the reactive payload small.
  • Exported query name kept as getExecutionStepStatusesBug: No Clear Error Feedback in Test Panel #1484 and Improvement: Add Step-by-Step Debug Mode #1490 build on it.

Verification

Performed:

  • bun run check at repo root (format, lint, typecheck, all tests) — green.
  • bun run --filter @tale/platform test:ui — 282 files / 2206 tests green (not part of the root test task).
  • New unit tests: 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):

  • Live end-to-end repro: run a workflow from the test panel and watch badges progress in real time; shard-bug regression sweep (≥8 executions, journal non-empty for every run); sanity-check of the 8KB cap on an LLM-heavy workflow.

Manual verification required

  • Design sign-off (issue is tagged needs-discussion): badge placement (top-right corner overlay), popover contents/width, ring tints, and the viewing-run banner placement need a design pass before polish.

Pre-PR checklist

  • Ran bun run check (format, lint, typecheck, all tests).
  • No hand-rolled skeletons or magic h-[…] on skeletons — N/A (no loading states added).
  • Updated services/platform/messages/{en,de,fr}.json.
  • Updated /docs/{en,de,fr}/ for every user-visible change.
  • Every touched docs page has a real opening and closing (existing page, paragraph added mid-page; opening/closing tests pass).
  • Ran bun run --filter @tale/docs lint and bun run --filter @tale/docs test.
  • Updated README.md / README.de.md / README.fr.md — N/A.

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).
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@yannickmonney, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e4f30acd-99dc-4311-8216-3b3257954761

📥 Commits

Reviewing files that changed from the base of the PR and between ab128af and 25f8ba2.

⛔ Files ignored due to path filters (1)
  • services/platform/convex/_generated/api.d.ts is excluded by !**/_generated/**
📒 Files selected for processing (24)
  • docs/de/platform/automations/workflows.md
  • docs/en/platform/automations/workflows.md
  • docs/fr/platform/automations/workflows.md
  • services/platform/app/features/automations/components/automation-loop-container.tsx
  • services/platform/app/features/automations/components/automation-step.test.tsx
  • services/platform/app/features/automations/components/automation-step.tsx
  • services/platform/app/features/automations/components/automation-steps.tsx
  • services/platform/app/features/automations/components/automation-tester.test.tsx
  • services/platform/app/features/automations/components/automation-tester.tsx
  • services/platform/app/features/automations/components/execution-status-context.tsx
  • services/platform/app/features/automations/components/node-execution-status-badge.tsx
  • services/platform/app/features/automations/hooks/queries.ts
  • services/platform/app/routes/dashboard/$id/automations/$amId.tsx
  • services/platform/convex/wf_executions/queries.ts
  • services/platform/convex/workflows/executions/get_execution_step_journal.test.ts
  • services/platform/convex/workflows/executions/get_execution_step_journal.ts
  • services/platform/convex/workflows/executions/get_execution_step_statuses.test.ts
  • services/platform/convex/workflows/executions/get_execution_step_statuses.ts
  • services/platform/convex/workflows/executions/get_workflow_component.test.ts
  • services/platform/convex/workflows/executions/get_workflow_component.ts
  • services/platform/convex/workflows/executions/helpers.ts
  • services/platform/messages/de.json
  • services/platform/messages/en.json
  • services/platform/messages/fr.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/workflow-node-execution-status

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@yannickmonney yannickmonney merged commit 7d9260c into main Jun 11, 2026
30 checks passed
@yannickmonney yannickmonney deleted the feat/workflow-node-execution-status branch June 11, 2026 00:20
yannickmonney added a commit that referenced this pull request Jun 11, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Missing Node Status Indicators

1 participant