docs(workflow): rename triggerJobFunction to execJobFunction in guides - #179
Conversation
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.
There was a problem hiding this comment.
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(...)withtailor.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 astailor.workflow.startJobFunction()(withtriggerJobFunctionas an alias). Consider keeping the guide consistent with the SDK docs untilexecJobFunctionis 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 documenttailor.workflow.startJobFunction(...)(aliastriggerJobFunction). 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>.
Resolve conflict in docs/guides/function/builtin-interfaces.md by keeping the execJobFunction rename from this branch with main's aligned table formatting.
Summary
The workflow runtime is aligning the durable "run a job function and return its result" call to a single canonical name:
execJobFunction.triggerJobFunctionstays as a permanent frozen alias, and the earlier interim namestartJobFunctionis being dropped so no new adoption accrues.docs/sdk/**already reflects that story via the dailysdk-docs-syncworkflow (sourced fromtailor-platform/sdk), so this PR closes the gap on the manually-maintained guide pages underdocs/guides/**, which still calledtailor.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 useexecJobFunction.docs/guides/workflow/creating-workflows.md— the four-step "Multi-step workflow" sample under Example: Multi-step workflow now usesexecJobFunction.docs/guides/workflow/wait-resolve.md— thewait()/resolve()samples (two occurrences each in the "wait for approval" and typical-pattern flows) now useexecJobFunction.docs/guides/function/builtin-interfaces.md— the twotailor.workflow.*snippets, the API-summary table row, and the accompanying description under the Workflow Client section now useexecJobFunction(triggerWorkflowuntouched).docs/sdk/runtime.md,docs/sdk/services/workflow.md, anddocs/sdk/testing.mdstill mention the pre-alignment names; those pages are overwritten daily bysdk-docs-syncand are updated at the SDK source.Verification
pnpm build✅ (234 URLs in sitemap, no schema or link errors)pnpm lint✅ (only the pre-existingsitemap.tsunused-param warning)