Skip to content

Commit d932737

Browse files
authored
update workflows changelog and added instanceId to theWorkflowEvent params (#18869)
1 parent dfb6ead commit d932737

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

src/content/changelogs/workflows.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ productLink: "/workflows/"
55
productArea: Developer platform
66
productAreaLink: /workers/platform/changelog/platform/
77
entries:
8+
- publish_date: "2024-12-19"
9+
title: "Better instance control, improved queued logic, and step limit increased"
10+
description: |-
11+
Workflows can now be terminated and pause instances from a queued state and the ID of an instance is now exposed via the `WorkflowEvent` parameter.
12+
13+
Also, the mechanism to queue instances was improved to force miss-behaved queued instances to be automatically errored.
14+
15+
Workflows now allow you to define up to 1024 steps in a single Workflow definition, up from the previous limit of 512. This limit will continue to increase during the course of the open beta.
16+
- publish_date: "2024-12-09"
17+
title: "New queue instances logic"
18+
description: |-
19+
Introduction of a new mechanism to queue instances, which will prevent instances from getting stuck on queued status forever.
820
- publish_date: "2024-11-30"
921
title: "Step limit increased"
1022
description: |-

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,16 @@ npx wrangler@latest workflows trigger workflows-starter '{"some":"data"}'
6262

6363
## TypeScript and type parameters
6464

65-
By default, the `WorkflowEvent` passed to the `run` method of your Workflow definition has a type that conforms to the following, with `payload` (your data) and `timestamp` properties:
65+
By default, the `WorkflowEvent` passed to the `run` method of your Workflow definition has a type that conforms to the following, with `payload` (your data), `timestamp`, and `instanceId` properties:
6666

6767
```ts
6868
export type WorkflowEvent<T> = {
6969
// The data passed as the parameter when the Workflow instance was triggered
7070
payload: T;
7171
// The timestamp that the Workflow was triggered
7272
timestamp: Date;
73+
// ID of the associated instance
74+
instanceId: string;
7375
};
7476
```
7577

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ Refer to the [events and parameters](/workflows/build/events-and-parameters/) do
3737
export type WorkflowEvent<T> = {
3838
payload: Readonly<T>;
3939
timestamp: Date;
40+
instanceId: string;
4041
};
4142
```
4243

4344
* The `WorkflowEvent` is the first argument to a Workflow's `run` method, and includes an optional `payload` parameter and a `timestamp` property.
4445

4546
* `payload` - a default type of `any` or type `T` if a type parameter is provided.
4647
* `timestamp` - a `Date` object set to the time the Workflow instance was created (triggered).
48+
* `instanceId` - the ID of the associated instance.
4749

4850
Refer to the [events and parameters](/workflows/build/events-and-parameters/) documentation for how to handle events within yur Workflow code.
4951

src/content/docs/workflows/reference/limits.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Many limits are inherited from those applied to Workers scripts and as documente
2121
| Maximum persisted state per step | 1MiB (2^20 bytes) | 1MiB (2^20 bytes) |
2222
| Maximum state that can be persisted per Workflow instance | 100MB | 1GB |
2323
| Maximum `step.sleep` duration | 365 days (1 year) [^1] | 365 days (1 year) [^1] |
24-
| Maximum steps per Workflow [^5] | 512 [^1] | 512 [^1] |
24+
| Maximum steps per Workflow [^5] | 1024 [^1] | 1024 [^1] |
2525
| Maximum Workflow executions | 100,000 per day [shared with Workers daily limit](/workers/platform/limits/#worker-limits) | Unlimited |
26-
| Concurrent Workflow instances (executions) | 25 | 100 [^1] |
26+
| Concurrent Workflow instances (executions) per account | 25 | 100 [^1] |
2727
| Retention limit for completed Workflow state | 3 days | 30 days [^2] |
2828
| Maximum length of a Workflow ID [^4] | 64 characters | 64 characters |
2929

0 commit comments

Comments
 (0)