Skip to content

docs(workflow): document tailor.workflow.resumeWorkflow#155

Merged
anukiransolur merged 4 commits into
mainfrom
resume
Jul 2, 2026
Merged

docs(workflow): document tailor.workflow.resumeWorkflow#155
anukiransolur merged 4 commits into
mainfrom
resume

Conversation

@k1LoW

@k1LoW k1LoW commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

The SDK now exposes tailor.workflow.resumeWorkflow(executionId) on @tailor-platform/sdk/runtime, so user code can resume a failed or pending-retry workflow execution directly instead of shelling out to tailor-sdk workflow resume or using the Tailor Console (tailor-platform/sdk#1608). The workflow guides only documented the CLI resume command, so this documents the in-code path that self-healing flows (functions, executors, pipeline resolvers) can use.

While documenting it, this also reviews the existing samples in the workflow guides so they no longer wrap runtime results in a { success } object.

Changes

Document resumeWorkflow

  • docs/guides/workflow/monitoring-executions.md — add a Resuming from Code subsection under Resume and Retry. Documents tailor.workflow.resumeWorkflow(executionId): an example that recovers from a transient failure, the string argument (a failed or pending-retry execution ID) and string return value (the resumed execution ID), the shared cached-result behavior with the resume command, and the resumeWorkflow failed: error it rejects with. Uses the global tailor.workflow.* form to match the existing triggerWorkflow() examples in the guides.

docs/sdk/runtime.md and docs/sdk/testing.md are intentionally not edited here. They are auto-synced from the SDK repo by the sdk-docs-sync workflow, and tailor-platform/sdk#1608 already updates those source pages (the workflow namespace list and a mockWorkflow().setResumeHandler testing section).

Sample cleanup

The tailor.workflow.* runtime calls reject on failure, so returning { success: true } (or catching to return { success: false }) makes the samples read as if they presuppose try/catch-based error handling. The samples now return the meaningful result directly and let errors propagate as thrown exceptions.

  • In docs/guides/workflow/triggering-workflow.md, drop the redundant success: true from the triggerWorkflow() example return.
  • In docs/guides/workflow/creating-workflows.md, drop success: true from the multi-step example, and simplify the error-handling sample to return { result }. Its try/catch stays, since re-throwing a wrapped error message is the case where catching is warranted.
  • In docs/guides/workflow/monitoring-executions.md, write the new Resuming from Code example so it lets the error propagate instead of catching it into a { success } object.

Verification

  • pnpm build ✅ (pages render; new #resuming-from-code anchor generated)
  • pnpm lint ✅ (no new issues; only a pre-existing sitemap.ts unused-param warning)
  • npx tsx scripts/validate-schema.mts ⚠️ not run to completion — mdschema is not installed in this environment (mdschema: command not found); no doc-structure change was made (a new h3 under an existing h2, no heading-level skips)

k1LoW added 2 commits July 2, 2026 09:37
The SDK now exposes `tailor.workflow.resumeWorkflow(executionId)` so user
code can resume a failed or pending-retry execution directly
(tailor-platform/sdk#1608). The workflow guides only covered the
`tailor-sdk workflow resume` CLI command, leaving self-healing flows
(functions, executors, pipeline resolvers) with no in-code path to point
readers at. Add a "Resuming from Code" subsection to the monitoring guide
covering the API, its return value, and the error it rejects with.
Review the workflow guide samples for the same result-object smell fixed
in the IdP guide. The `tailor.workflow.*` runtime calls reject on
failure, so wrapping their results in `{ success: true }` (and, in the
resumeWorkflow example, catching to return `{ success: false }`) made the
samples read as if they presuppose try/catch-based error handling.

Drop the redundant `success` field from the triggerWorkflow, multi-step,
and error-handling samples, and rewrite the resumeWorkflow example to let
the error propagate. Keep the one try/catch that re-throws a wrapped
message, since controlling the error message is the case where catching
is warranted.

This comment was marked as outdated.

Apply Copilot review feedback on the Resuming from Code section.

- Use `args.executionId` in the example so it matches the
  `resumeWorkflow(executionId)` signature and the `executionId` term used
  elsewhere in the guide.
- Reword the behavior paragraph to match the "restart from main, reuse
  cached results" mechanics described earlier in the section, rather than
  the looser "resumes from the point of failure" phrasing.

This comment was marked as outdated.

Apply Copilot review feedback. The intro said "a failed execution" while
the API reference below and the SDK changeset both cover "failed or
pending-retry" executions, so widen the intro to match and avoid
implying resumeWorkflow cannot resume pending-retry executions.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@k1LoW k1LoW self-assigned this Jul 2, 2026
@k1LoW k1LoW marked this pull request as ready for review July 2, 2026 04:32
@k1LoW k1LoW requested a review from a team as a code owner July 2, 2026 04:32
@anukiransolur anukiransolur merged commit 82a8b0f into main Jul 2, 2026
4 checks passed
@anukiransolur anukiransolur deleted the resume branch July 2, 2026 17:01
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.

3 participants