Skip to content

feat(types): Add wait and resolve types to tailor.workflow#154

Merged
k1LoW merged 1 commit intomainfrom
add-workflow-wait-resolve-types
Mar 26, 2026
Merged

feat(types): Add wait and resolve types to tailor.workflow#154
k1LoW merged 1 commit intomainfrom
add-workflow-wait-resolve-types

Conversation

@k1LoW
Copy link
Copy Markdown
Contributor

@k1LoW k1LoW commented Mar 25, 2026

Summary

Add TypeScript type definitions for workflow wait/resolve API (tailor.workflow namespace) to support human-in-the-loop workflows.

Added functions

  • wait(key, payload?) - Suspends the current workflow execution and waits for an external signal to resume. Returns the result provided by the resolve() callback.
  • resolve(executionId, key, callback) - Resolves a waiting workflow execution. The callback receives the wait payload and returns a result passed back to the wait() caller.

Usage

// In a workflow job function — pause and wait for approval
const result = tailor.workflow.wait("approval", {
  message: "Please approve this request",
  requestId: "req-123",
});

// In another function — resolve the waiting workflow
await tailor.workflow.resolve(executionId, "approval", (waitPayload) => {
  return { approved: true, approver: "admin" };
});

@k1LoW k1LoW requested a review from a team as a code owner March 25, 2026 09:39
@k1LoW k1LoW self-assigned this Mar 25, 2026
@k1LoW k1LoW merged commit e9a2860 into main Mar 26, 2026
6 checks passed
@k1LoW k1LoW deleted the add-workflow-wait-resolve-types branch March 26, 2026 07:03
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.

2 participants