Skip to content

feat: per-workflow timeout + run-level error in execution log#268

Merged
ckakgun merged 3 commits into
mainfrom
impl/workflow-timeout
Jun 29, 2026
Merged

feat: per-workflow timeout + run-level error in execution log#268
ckakgun merged 3 commits into
mainfrom
impl/workflow-timeout

Conversation

@ckakgun

@ckakgun ckakgun commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a per-workflow timeout (seconds) configured in the workflow-level Properties panel (default 0 = disabled). When a run exceeds the limit it is stopped at the next node boundary and recorded as a failed run with a "timed out" error.
  • Enforced cooperatively via a deadline checked in WorkflowExecutor.check_cancelled, so it applies to manual (streaming), API, and triggered runs. WorkflowTimeoutError subclasses WorkflowCancelledError so existing unwind/retry handling is reused.
  • Long Wait nodes now sleep in slices so a timeout interrupts them promptly instead of blocking the full duration.
  • Surface run-level errors (e.g. a timeout, which has no per-node result) in the canvas Execution Log empty state — previously only the history dialogs showed it.
  • Note in the Properties panel that the error workflow is not triggered on manual test runs.

Changes

  • DB: workflows.workflow_timeout_seconds column + migration 089_workflow_timeout.
  • Schemas + update endpoint persistence; threaded timeout_seconds into execute_workflow and execute_workflow_streaming; streaming endpoint converts a timeout into a failed execution_complete.
  • Frontend: Workflow type, workflowApi.update, Properties panel input, DebugPanel run-level error display.
  • Docs: Workflow Timeout section + manual-test-run note in features.md.

Test Plan

  • Backend unit + integration tests (tests/test_workflow_timeout.py): deadline check, disabled timeout, and a 3s wait + 1s timeout returning an error result in <2.5s.
  • Updated streaming-executor test fakes for the new timeout_seconds / _arm_deadline interface; full ./check.sh green (1 known-flaky chart test passes in isolation).
  • E2E (e2e/workflow-timeout.spec.ts): 3s wait + 1s timeout fails the run and the "timed out" error shows in the canvas execution log.

🤖 Generated with Claude Code

ckakgun and others added 3 commits June 29, 2026 08:17
Add a workflow-level timeout configured in the Properties panel (default 0 =
disabled). When a run exceeds the limit it is stopped at the next node boundary
and recorded as a failed run with a 'timed out' error. Enforced cooperatively
via a deadline checked in WorkflowExecutor.check_cancelled, so it applies to
manual (streaming), API, and triggered runs. Long Wait nodes sleep in slices so
they are interrupted promptly.

Also note in the properties panel that the error workflow is not triggered on
manual test runs.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
When a run fails without per-node results (such as a workflow timeout), the
Execution Log showed only an ERROR header with an empty body. Surface the
run-level error message in the log empty state.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
A failed run with an empty final node_results (e.g. a workflow timeout) was
wiping the node rows already streamed during the run. Preserve the accumulated
node results when the completion event carries none, and render the run-level
error as a banner above the node history instead of replacing it.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@ckakgun ckakgun enabled auto-merge (squash) June 29, 2026 06:26
@ckakgun ckakgun merged commit ca53e3e into main Jun 29, 2026
2 checks passed
@ckakgun ckakgun deleted the impl/workflow-timeout branch June 29, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant