feat(cli): add durable workflow and executor waiters#1338
Open
dqn wants to merge 7 commits into
Open
Conversation
🦋 Changeset detectedLatest commit: 0b8ef93 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
This comment has been minimized.
This comment has been minimized.
Contributor
|
@dqn |
…r-waiters # Conflicts: # packages/sdk/docs/cli/workflow.md # packages/sdk/src/cli/commands/executor/jobs.ts # packages/sdk/src/cli/commands/workflow/executions.ts # packages/sdk/src/cli/commands/workflow/start.test.ts # packages/sdk/src/cli/commands/workflow/start.ts
Code Metrics Report (packages/sdk)
Details | | main (36f3d1d) | #1338 (a82147b) | +/- |
|--------------------|----------------|-----------------|-------|
+ | Coverage | 68.8% | 69.5% | +0.7% |
| Files | 420 | 422 | +2 |
| Lines | 14898 | 15078 | +180 |
+ | Covered | 10250 | 10490 | +240 |
- | Code to Test Ratio | 1:0.4 | 1:0.4 | -0.1 |
| Code | 99713 | 100903 | +1190 |
+ | Test | 44571 | 45065 | +494 |Code coverage of files in pull request scope (9.7% → 40.8%)
SDK Configure Bundle Size
Runtime Performance
Type Performance (instantiations)
Reported by octocov |
Contributor
Author
|
Resolved the merge conflict. |
There was a problem hiding this comment.
📖 Docs Quality & Consistency Check
✅ Docs are consistent with the implementation and contain no user-facing internal-detail leaks.
Checked areas:
packages/sdk/docs/cli-reference.md- verified newworkflow waitcommand entry matches implementationpackages/sdk/docs/cli/workflow.md- verified all command options (defaults, aliases, descriptions) match command definitions inpackages/sdk/src/cli/commands/workflow/wait.tsandargs.tspackages/sdk/docs/cli/executor.md- verified timeout option additions and shell automation examples match implementation- Shell automation examples - verified all examples use correct command syntax and options
- Programmatic API examples - verified
waitWorkflowExecutionandwatchExecutorJobfunction signatures match exported functions frompackages/sdk/src/cli/lib.ts - JSDoc comments on exported functions - verified they describe user-facing behavior without leaking internal implementation details
Implementation consistency verified:
- CLI command options (interval, timeout, until, logs) match their definitions in
packages/sdk/src/cli/commands/workflow/args.ts - Default values documented correctly:
interval: "3s",timeout: "10m"(workflow),timeout: "5m"(executor),until: "terminal" - Wait targets (
success,suspended,terminal) match theWorkflowWaitUntiltype definition - Return types documented correctly:
WorkflowWaitResultincludesstatusClass,elapsedMs,attempts,timedOut,lastError - Executor wait result includes
targetType,job,workflowExecutionId,functionExecutionIdfields as implemented
Reader perspective verified:
- Documentation uses only user-facing terminology (execution, job, workflow, executor, wait target)
- No protobuf/gRPC terminology exposed
- No internal module structure (
parser,configure,cli) mentioned - No internal class/method names revealed
- Examples import only from public API:
@tailor-platform/sdk/cli - Describes observable behavior, not internal mechanics (e.g., "wait for completion" not "poll platform RPC until terminal state")
Re-run this check by adding the
docs-checklabel to the PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add durable waiter commands and shared polling behavior for workflow executions and executor jobs so automation can wait through transient platform states with stable JSON diagnostics.
Main changes
workflow wait <execution-id>and reuse the workflow waiter fromworkflow start --wait,workflow executions --wait, andworkflow resume --wait.executor trigger --waitandexecutor jobs ... --waitwith timeout diagnostics and downstream execution tracking.Examples
Wait for a workflow execution captured from
workflow start:Wait for an executor job and downstream execution:
Use the programmatic workflow waiter:
Use the programmatic executor waiter: