Skip to content

Commit 2adf28e

Browse files
committed
Renaming Workers API to Workflows API for Workflow APIs
1 parent ada5104 commit 2adf28e

File tree

15 files changed

+22
-21
lines changed

15 files changed

+22
-21
lines changed

public/__redirects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,6 +1936,7 @@
19361936
# workflows
19371937
/workflows/reference/storage-options/ /workers/platform/storage-options/ 301
19381938
/workflows/tutorials/ /workflows/examples 301
1939+
/workflows/build/workers-api/ /workflows/build/workflows-api/ 301
19391940

19401941
# workers KV
19411942
/kv/platform/environments/ /kv/reference/environments/ 301

src/content/changelog/workflows/2024-10-24-workflows-beta.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ npm create cloudflare@latest workflows-starter -- --template "cloudflare/workflo
2323

2424
You can open the `src/index.ts` file, extend it, and use `wrangler deploy` to deploy your first Workflow. From there, you can:
2525

26-
- Learn the [Workflows API](/workflows/build/workers-api/)
26+
- Learn the [Workflows API](/workflows/build/workflows-api/)
2727
- [Trigger Workflows](/workflows/build/trigger-workflows/) via your Workers apps.
2828
- Understand the [Rules of Workflows](/workflows/build/rules-of-workflows/) and how to adopt best practices

src/content/changelog/workflows/2025-01-15-workflows-more-steps.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ products:
66
date: 2025-01-15
77
---
88

9-
[Workflows](/workflows/) (beta) now allows you to define up to 1024 [steps](/workflows/build/workers-api/#workflowstep). `sleep` steps do not count against this limit.
9+
[Workflows](/workflows/) (beta) now allows you to define up to 1024 [steps](/workflows/build/workflows-api/#workflowstep). `sleep` steps do not count against this limit.
1010

1111
We've also added:
1212

13-
* `instanceId` as property to the [`WorkflowEvent`](/workflows/build/workers-api/#workflowevent) type, allowing you to retrieve the current instance ID from within a running Workflow instance
13+
* `instanceId` as property to the [`WorkflowEvent`](/workflows/build/workflows-api/#workflowevent) type, allowing you to retrieve the current instance ID from within a running Workflow instance
1414
* Improved queueing logic for Workflow instances beyond the current maximum concurrent instances, reducing the cases where instances are stuck in the queued state.
15-
* Support for [`pause` and `resume`](/workflows/build/workers-api/#pause) for Workflow instances in a queued state.
15+
* Support for [`pause` and `resume`](/workflows/build/workflows-api/#pause) for Workflow instances in a queued state.
1616

1717
We're continuing to work on increases to the number of concurrent Workflow instances, steps, and support for a new `waitForEvent` API over the coming weeks.

src/content/changelog/workflows/2025-04-07-workflows-ga.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class MyWorkflow extends WorkflowEntrypoint<Env, Params> {
4242

4343
</TypeScriptExample>
4444

45-
You can then send a Workflow an event from an external service via HTTP or from within a Worker using the [Workers API](/workflows/build/workers-api/) for Workflows:
45+
You can then send a Workflow an event from an external service via HTTP or from within a Worker using the [Workers API](/workflows/build/workflows-api/) for Workflows:
4646

4747
<TypeScriptExample>
4848

src/content/docs/agents/api-reference/run-workflows.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ You can also call a Workflow that is defined in a different Workers script from
105105

106106
</WranglerConfig>
107107

108-
Refer to the [cross-script calls](/workflows/build/workers-api/#cross-script-calls) section of the Workflows documentation for more examples.
108+
Refer to the [cross-script calls](/workflows/build/workflows-api/#cross-script-calls) section of the Workflows documentation for more examples.

src/content/docs/workers/configuration/cron-triggers.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Cron Triggers are ideal for running periodic jobs, such as for maintenance or ca
1515

1616
:::note
1717

18-
Cron Triggers can also be combined with [Workflows](/workflows/) to trigger multi-step, long-running tasks. You can [bind to a Workflow](/workflows/build/workers-api/) from directly from your Cron Trigger to execute a Workflow on a schedule.
18+
Cron Triggers can also be combined with [Workflows](/workflows/) to trigger multi-step, long-running tasks. You can [bind to a Workflow](/workflows/build/workflows-api/) from directly from your Cron Trigger to execute a Workflow on a schedule.
1919

2020
:::
2121

src/content/docs/workflows/build/call-workflows-from-pages.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ services = [
3737

3838
Your Worker can expose a specific method (or methods) that only other Workers or Pages Functions can call over the Service Binding.
3939

40-
In the following example, we expose a specific `createInstance` method that accepts our `Payload` and returns the [`InstanceStatus`](/workflows/build/workers-api/#instancestatus) from the Workflows API:
40+
In the following example, we expose a specific `createInstance` method that accepts our `Payload` and returns the [`InstanceStatus`](/workflows/build/workflows-api/#instancestatus) from the Workflows API:
4141

4242
<TypeScriptExample filename="index.ts">
4343
```ts
@@ -97,7 +97,7 @@ Service Bindings don't require you to expose a public endpoint from your Worker,
9797

9898
:::
9999

100-
An alternative to setting up a Service Binding is to call the Worker over HTTP by using the Workflows [Workers API](/workflows/build/workers-api/#workflow) to `create` a new Workflow instance for each incoming HTTP call to the Worker:
100+
An alternative to setting up a Service Binding is to call the Worker over HTTP by using the Workflows [Workers API](/workflows/build/workflows-api/#workflow) to `create` a new Workflow instance for each incoming HTTP call to the Worker:
101101

102102
<TypeScriptExample filename="index.ts">
103103
```ts
@@ -137,6 +137,6 @@ You can also choose to authenticate these requests by passing a shared secret in
137137

138138
### Next steps
139139

140-
* Learn more about how to programatically call and trigger Workflows from the [Workers API](/workflows/build/workers-api/)
140+
* Learn more about how to programatically call and trigger Workflows from the [Workers API](/workflows/build/workflows-api/)
141141
* Understand how to send [events and parameters](/workflows/build/events-and-parameters/) when triggering a Workflow
142142
* Review the [Rules of Workflows](/workflows/build/rules-of-workflows/) and best practices for writing Workflows

src/content/docs/workflows/build/events-and-parameters.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ npx wrangler@latest workflows trigger workflows-starter '{"some":"data"}'
6767

6868
A running Workflow can wait for an event (or events) by calling `step.waitForEvent` within the Workflow, which allows you to send events to the Workflow in one of two ways:
6969

70-
1. Via the [Workers API binding](/workflows/build/workers-api/): call `instance.sendEvent` to send events to specific workflow instances.
70+
1. Via the [Workers API binding](/workflows/build/workflows-api/): call `instance.sendEvent` to send events to specific workflow instances.
7171
2. Using the REST API (HTTP API)'s [Events endpoint](/api/resources/workflows/subresources/instances/subresources/events/methods/create/).
7272

7373
Because `waitForEvent` is part of the `WorkflowStep` API, you can call it multiple times within a Workflow, and use control flow to conditionally wait for an event.

src/content/docs/workflows/build/rules-of-workflows.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ export class MyWorkflow extends WorkflowEntrypoint {
380380

381381
### Instance IDs are unique
382382

383-
Workflow [instance IDs](/workflows/build/workers-api/#workflowinstance) are unique per Workflow. The ID is the unique identifier that associates logs, metrics, state and status of a run to a specific instance, even after completion. Allowing ID re-use would make it hard to understand if a Workflow instance ID referred to an instance that run yesterday, last week or today.
383+
Workflow [instance IDs](/workflows/build/workflows-api/#workflowinstance) are unique per Workflow. The ID is the unique identifier that associates logs, metrics, state and status of a run to a specific instance, even after completion. Allowing ID re-use would make it hard to understand if a Workflow instance ID referred to an instance that run yesterday, last week or today.
384384

385385
It would also present a problem if you wanted to run multiple different Workflow instances with different [input parameters](/workflows/build/events-and-parameters/) for the same user ID, as you would immediately need to determine a new ID mapping.
386386

@@ -452,7 +452,7 @@ export class MyWorkflow extends WorkflowEntrypoint {
452452

453453
### Batch multiple Workflow invocations
454454

455-
When creating multiple Workflow instances, use the [`createBatch`](/workflows/build/workers-api/#createBatch) method to batch the invocations together. This allows you to create multiple Workflow instances in a single request, which will reduce the number of requests made to the Workflows API and increase the number of instances you can create per minute.
455+
When creating multiple Workflow instances, use the [`createBatch`](/workflows/build/workflows-api/#createBatch) method to batch the invocations together. This allows you to create multiple Workflow instances in a single request, which will reduce the number of requests made to the Workflows API and increase the number of instances you can create per minute.
456456

457457
<TypeScriptExample filename="index.ts">
458458

src/content/docs/workflows/build/workers-api.mdx renamed to src/content/docs/workflows/build/workflows-api.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Workers API
2+
title: Workflows API
33
pcx_content_type: concept
44
sidebar:
55
order: 2
@@ -29,7 +29,7 @@ export class MyWorkflow extends WorkflowEntrypoint<Env, Params> {
2929
* `event` - the event passed to the Workflow, including an optional `payload` containing data (parameters)
3030
* `step` - the `WorkflowStep` type that provides the step methods for your Workflow
3131

32-
The `run` method can optionally return data, which is available when querying the instance status via the [Workers API](/workflows/build/workers-api/#instancestatus), [REST API](/api/resources/workflows/subresources/instances/subresources/status/) and the Workflows dashboard. This can be useful if your Workflow is computing a result, returning the key to data stored in object storage, or generating some kind of identifier you need to act on.
32+
The `run` method can optionally return data, which is available when querying the instance status via the [Workers API](/workflows/build/workflows-api/#instancestatus), [REST API](/api/resources/workflows/subresources/instances/subresources/status/) and the Workflows dashboard. This can be useful if your Workflow is computing a result, returning the key to data stored in object storage, or generating some kind of identifier you need to act on.
3333

3434
```ts
3535
export class MyWorkflow extends WorkflowEntrypoint<Env, Params> {

0 commit comments

Comments
 (0)