Skip to content

feat(temporal): support node activity heartbeat timeouts - #201

Open
tbrandenburg wants to merge 1 commit into
synergycodes:mainfrom
tbrandenburg:feat/temporal-heartbeat
Open

tbrandenburg wants to merge 1 commit into
synergycodes:mainfrom
tbrandenburg:feat/temporal-heartbeat

Conversation

@tbrandenburg

Copy link
Copy Markdown

Summary

Extract the optional node-activity heartbeatTimeout support from #148, as requested in #148 (comment).

The production change is limited to the profile type, existing duration validation, and forwarding the optional timeout to proxyActivities. Executors use Temporal's native Context.current().heartbeat() and cancellationSignal; the documentation includes a shell-backed example. A minor changeset is included for @workflowbuilder/temporal.

This is based on current upstream main and has no agent-harness, provider, task-queue routing, or copied Archon implementation dependency. It addresses the heartbeat-related request, not the complete agent-harness feature in #147.

End-to-end evidence

Three integration tests run the actual Workflow Builder plugin and graph runner against a fresh local Temporal server, with real sh/sleep subprocesses and no mocked Temporal or process execution:

  • A four-second shell step survives a two-second heartbeat timeout, finishes successfully, and its output reaches downstream. Event History contains the configured heartbeat timeout.
  • Workflow cancellation aborts the shell process while the worker is still running, verifies that the PID no longer exists, records cancelled, and does not execute downstream. The test requires cleanup within ten seconds, before its twenty-second command completes naturally.
  • Stopping heartbeats records a HEARTBEAT timeout in Event History within fifteen seconds, before the thirty-second start-to-close limit. The side-effecting step has one attempt and downstream does not execute.

The README distinguishes worker liveness from subprocess progress, explains heartbeat throttling, and makes process-tree cleanup the executor's responsibility. Heartbeating is required for cancellation delivery; setting heartbeatTimeout is not itself required to receive cancellation.

Validation conducted

  • pnpm install --frozen-lockfile
  • pnpm --filter @workflowbuilder/temporal test — 172 tests passed, including real-server heartbeat checks and replay coverage for prior histories.
  • pnpm test — 1,943 tests passed across ten workspace suites.
  • pnpm --filter @workflowbuilder/temporal typecheck
  • pnpm lint and pnpm lint:styles
  • Repository-wide Prettier check, including tools/**/*.mjs.
  • pnpm exec eslint tools --max-warnings=0 and pnpm test:tools — 8 tests passed.
  • pnpm build:temporal
  • pnpm dlx publint@0.3.24 and pnpm dlx @arethetypeswrong/cli@0.18.5 --pack --profile esm-only in packages/temporal.
  • pnpm exec changeset status — temporal minor bump.

Repository-wide pnpm typecheck fails with four existing errors in apps/docs/src/components/head.astro and sidebar.astro (video element types, sidebar types, and MobileMenuFooter resolution). Those files are identical to upstream main, the lockfile is unchanged, and no docs-app source changes are included. The other fourteen workspace typechecks pass. The package-specific Temporal gate passes.

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.

1 participant