Skip to content

feat(cli): add durable workflow and executor waiters#1338

Draft
dqn wants to merge 6 commits into
mainfrom
feat/workflow-executor-waiters
Draft

feat(cli): add durable workflow and executor waiters#1338
dqn wants to merge 6 commits into
mainfrom
feat/workflow-executor-waiters

Conversation

@dqn
Copy link
Copy Markdown
Contributor

@dqn dqn commented Jun 5, 2026

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

  • Add workflow wait <execution-id> and reuse the workflow waiter from workflow start --wait, workflow executions --wait, and workflow resume --wait.
  • Add workflow wait targets, timeout handling, retryable polling, log support, and JSON diagnostics.
  • Harden executor job waiting for executor trigger --wait and executor jobs ... --wait with timeout diagnostics and downstream execution tracking.
  • Document shell automation commands and programmatic API examples for workflow and executor waiters.

Examples

Wait for a workflow execution captured from workflow start:

execution_id="$(
  tailor-sdk workflow start order-workflow --json | jq -r '.executionId'
)"

tailor-sdk workflow wait "$execution_id" \
  --until success \
  --timeout 10m \
  --interval 5s \
  --json

Wait for an executor job and downstream execution:

tailor-sdk executor trigger daily-workflow \
  --wait \
  --timeout 5m \
  --interval 5s \
  --json

Use the programmatic workflow waiter:

import { waitWorkflowExecution } from "@tailor-platform/sdk/cli";

const result = await waitWorkflowExecution({
  executionId,
  until: "success",
  timeout: 10 * 60 * 1000,
  interval: 5000,
});

Use the programmatic executor waiter:

import { triggerExecutor, watchExecutorJob } from "@tailor-platform/sdk/cli";
import dailyWorkflow from "../executors/dailyWorkflow";

const { jobId } = await triggerExecutor({
  executor: dailyWorkflow,
});

const result = await watchExecutorJob({
  executor: dailyWorkflow,
  jobId,
  timeout: 5 * 60 * 1000,
  interval: 5000,
});

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 5, 2026

🦋 Changeset detected

Latest commit: 42f5eb9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@tailor-platform/sdk Minor
@tailor-platform/create-sdk Minor

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 5, 2026

Open in StackBlitz

pnpm add https://pkg.pr.new/@tailor-platform/create-sdk@42f5eb9
pnpm add https://pkg.pr.new/@tailor-platform/sdk@42f5eb9

commit: 42f5eb9

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

Code Metrics Report (packages/sdk)

main (66862a9) #1338 (20ab1d1) +/-
Coverage 66.0% 66.9% +0.8%
Code to Test Ratio 1:0.4 1:0.4 -0.1
Details
  |                    | main (66862a9) | #1338 (20ab1d1) |  +/-  |
  |--------------------|----------------|-----------------|-------|
+ | Coverage           |          66.0% |           66.9% | +0.8% |
  |   Files            |            394 |             396 |    +2 |
  |   Lines            |          13517 |           13699 |  +182 |
+ |   Covered          |           8931 |            9174 |  +243 |
- | Code to Test Ratio |          1:0.4 |           1:0.4 |  -0.1 |
  |   Code             |          90249 |           91443 | +1194 |
+ |   Test             |          39180 |           39674 |  +494 |

Code coverage of files in pull request scope (9.2% → 40.8%)

Files Coverage +/- Status
packages/sdk/src/cli/commands/executor/jobs.ts 33.8% +33.2% modified
packages/sdk/src/cli/commands/executor/status.ts 47.7% +18.3% modified
packages/sdk/src/cli/commands/executor/trigger.ts 35.8% +23.3% modified
packages/sdk/src/cli/commands/workflow/args.ts 100.0% 0.0% modified
packages/sdk/src/cli/commands/workflow/executions.ts 15.1% +14.2% modified
packages/sdk/src/cli/commands/workflow/index.ts 50.0% 0.0% modified
packages/sdk/src/cli/commands/workflow/resume.ts 3.2% -1.0% modified
packages/sdk/src/cli/commands/workflow/start.ts 69.0% +43.4% modified
packages/sdk/src/cli/commands/workflow/status.ts 90.4% +90.4% modified
packages/sdk/src/cli/commands/workflow/transform.ts 26.0% +26.0% modified
packages/sdk/src/cli/commands/workflow/wait.ts 47.6% +47.6% added
packages/sdk/src/cli/commands/workflow/waiter.ts 75.0% +75.0% added

SDK Configure Bundle Size

main (66862a9) #1338 (20ab1d1) +/-
configure-index-size 19.37KB 19.37KB 0KB
dependency-chunks-size 34.65KB 34.65KB 0KB
total-bundle-size 54.02KB 54.02KB 0KB

Runtime Performance

main (66862a9) #1338 (20ab1d1) +/-
Generate Median 2,672ms 2,806ms 134ms
Generate Max 2,696ms 2,831ms 135ms
Apply Build Median 2,709ms 2,847ms 138ms
Apply Build Max 2,733ms 2,892ms 159ms

Type Performance (instantiations)

main (66862a9) #1338 (20ab1d1) +/-
tailordb-basic 33,963 33,963 0
tailordb-optional 3,841 3,841 0
tailordb-relation 5,921 5,921 0
tailordb-validate 2,566 2,566 0
tailordb-hooks 5,767 5,767 0
tailordb-object 12,136 12,136 0
tailordb-enum 2,462 2,462 0
resolver-basic 9,424 9,424 0
resolver-nested 26,111 26,111 0
resolver-array 18,187 18,187 0
executor-schedule 4,234 4,234 0
executor-webhook 873 873 0
executor-record 6,659 6,659 0
executor-resolver 4,369 4,369 0
executor-operation-function 868 868 0
executor-operation-gql 869 869 0
executor-operation-webhook 888 888 0
executor-operation-workflow 1,714 1,714 0

Reported by octocov

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