Skip to content

docs(workflow): rename triggerJobFunction to execJobFunction in guides - #179

Merged
k1LoW merged 2 commits into
mainfrom
rename-exec-job-function
Jul 30, 2026
Merged

docs(workflow): rename triggerJobFunction to execJobFunction in guides#179
k1LoW merged 2 commits into
mainfrom
rename-exec-job-function

Conversation

@k1LoW

@k1LoW k1LoW commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

The workflow runtime is aligning the durable "run a job function and return its result" call to a single canonical name: execJobFunction. triggerJobFunction stays as a permanent frozen alias, and the earlier interim name startJobFunction is being dropped so no new adoption accrues. docs/sdk/** already reflects that story via the daily sdk-docs-sync workflow (sourced from tailor-platform/sdk), so this PR closes the gap on the manually-maintained guide pages under docs/guides/**, which still called tailor.workflow.triggerJobFunction() in every sample.

Changes

All four files are guide-side prose and code samples only. No structural additions and no changes under docs/sdk/**.

  • docs/guides/workflow/index.md — the multi-step example under Stack-Based Execution, and the two prose references to the runtime call under Job Function Execution Policies, now use execJobFunction.
  • docs/guides/workflow/creating-workflows.md — the four-step "Multi-step workflow" sample under Example: Multi-step workflow now uses execJobFunction.
  • docs/guides/workflow/wait-resolve.md — the wait() / resolve() samples (two occurrences each in the "wait for approval" and typical-pattern flows) now use execJobFunction.
  • docs/guides/function/builtin-interfaces.md — the two tailor.workflow.* snippets, the API-summary table row, and the accompanying description under the Workflow Client section now use execJobFunction (triggerWorkflow untouched).

docs/sdk/runtime.md, docs/sdk/services/workflow.md, and docs/sdk/testing.md still mention the pre-alignment names; those pages are overwritten daily by sdk-docs-sync and are updated at the SDK source.

Verification

  • pnpm build ✅ (234 URLs in sitemap, no schema or link errors)
  • pnpm lint ✅ (only the pre-existing sitemap.ts unused-param warning)

The workflow runtime is realigning the durable "run a job function and
return its result" call to `execJobFunction` as the canonical name.
`triggerJobFunction` stays as a permanent frozen alias (documented on
the auto-synced SDK reference pages), and the previously introduced
`startJobFunction` is being dropped so no new adoption accrues.

Update the manually-maintained guide samples in `docs/guides/**` to
call `tailor.workflow.execJobFunction()` instead of `triggerJobFunction()`.
`docs/sdk/**` is intentionally untouched: those pages are auto-synced
from `tailor-platform/sdk` by the `sdk-docs-sync` workflow, and the
frozen-alias story is documented there.

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

This PR updates manually maintained guide pages to use tailor.workflow.execJobFunction() instead of tailor.workflow.triggerJobFunction() to match the intended “run a job function and return its result” canonical naming in workflow samples.

Changes:

  • Replaced tailor.workflow.triggerJobFunction(...) with tailor.workflow.execJobFunction(...) across workflow guide examples and prose.
  • Updated the Function guide’s Workflow Client section (snippets + API table) to document execJobFunction(...).

Reviewed changes

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

File Description
docs/guides/workflow/wait-resolve.md Renames job-function dispatch calls in wait()/resolve() examples to execJobFunction.
docs/guides/workflow/index.md Renames job-function dispatch calls in the “Stack-Based Execution” example and related prose/signatures.
docs/guides/workflow/creating-workflows.md Renames job-function dispatch calls in the “Multi-step workflow” example.
docs/guides/function/builtin-interfaces.md Updates Workflow Client snippets and API table to execJobFunction wording/signature.
Comments suppressed due to low confidence (5)

docs/guides/workflow/index.md:131

  • This prose references tailor.workflow.execJobFunction(), but the SDK docs currently describe the name-based job dispatch API as tailor.workflow.startJobFunction() (with triggerJobFunction as an alias). Consider keeping the guide consistent with the SDK docs until execJobFunction is present there too.
### Job Function Execution Policies

Declare workspace-scoped execution policies with a per-key `maxConcurrentExecutions` cap, then route job function dispatches through them by passing `executionPolicyKey` on `job.trigger()` / `tailor.workflow.execJobFunction()`.

docs/guides/workflow/index.md:196

  • The function signature shown here (tailor.workflow.execJobFunction(name, args, options)) doesn’t match the currently synced SDK docs, which still document tailor.workflow.startJobFunction(...) (alias triggerJobFunction). Keeping this aligned avoids documenting an API name that may not exist for readers yet.
});

The same executionPolicyKey option is available on tailor.workflow.execJobFunction(name, args, options) when dispatching by name from a Function-service script.

Matching modes:

**docs/guides/workflow/wait-resolve.md:167**
* Same issue in this example: `execJobFunction` isn’t mentioned in the currently synced SDK docs, which still document `tailor.workflow.startJobFunction()` as the canonical API (alias `triggerJobFunction`). Keeping the guide aligned avoids documenting a name readers may not have yet.

const order = tailor.workflow.execJobFunction("prepareOrder", args);

// Pause and wait for human approval
const decision = await tailor.workflow.wait("approval", {
orderId: order.id,
items: order.items,
total: order.total,
});

// Resume after approval
if (decision.approved) {
tailor.workflow.execJobFunction("processOrder", {
orderId: order.id,

**docs/guides/function/builtin-interfaces.md:176**
* This snippet documents `tailor.workflow.execJobFunction()`, but `docs/sdk/runtime.md` and `docs/sdk/services/workflow.md` currently list the name-based API as `tailor.workflow.startJobFunction()` (alias `triggerJobFunction`). Unless `execJobFunction` is already shipped, the Function guide will be out of sync with the SDK reference.

This issue also appears on line 179 of the same file.

// Execute a job function
const result = await tailor.workflow.execJobFunction("calculateTax", {
amount: 1000,
});

// Route the dispatch through a workspace-registered execution policy for
// per-key concurrency control (see the SDK Workflow guide for policy setup).
const scoped = await tailor.workflow.execJobFunction(
"syncTenant",
{ tenantId: "acme" },
{ executionPolicyKey: tenant-api.acme },
);

**docs/guides/function/builtin-interfaces.md:183**
* The API summary table row lists `execJobFunction(...)`, but the SDK-synced docs in this repo currently document this as `startJobFunction(...)` (alias `triggerJobFunction`). Keeping the table aligned avoids advertising a method name readers may not have yet.
Function Returns Description
triggerWorkflow(name, args?, options?) Promise<string> Trigger a workflow. Returns the execution ID
execJobFunction(name, args?, options?) Promise<any> Execute a job function and return its result. options.executionPolicyKey routes the dispatch through a matching execution policy for per-key concurrency control
</details>



---

💡 <a href="/tailor-platform/docs/new/main?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.

Comment thread docs/guides/workflow/index.md
Comment thread docs/guides/workflow/creating-workflows.md
Comment thread docs/guides/workflow/wait-resolve.md
@k1LoW k1LoW self-assigned this Jul 23, 2026
@k1LoW
k1LoW marked this pull request as ready for review July 23, 2026 07:51
@k1LoW
k1LoW requested a review from a team as a code owner July 23, 2026 07:51
Resolve conflict in docs/guides/function/builtin-interfaces.md by
keeping the execJobFunction rename from this branch with main's
aligned table formatting.
@k1LoW
k1LoW merged commit 6a6f64b into main Jul 30, 2026
3 checks passed
@k1LoW
k1LoW deleted the rename-exec-job-function branch July 30, 2026 04:43
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