From 71a3db0ceb5bf61cf20ad3cd128dc6d7ae479dda Mon Sep 17 00:00:00 2001 From: Rocco Ghielmini Date: Fri, 18 Apr 2025 17:39:56 +0200 Subject: [PATCH 1/4] Update rules-of-workflows.mdx use unique ids as suggested by previous rule --- src/content/docs/workflows/build/rules-of-workflows.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/workflows/build/rules-of-workflows.mdx b/src/content/docs/workflows/build/rules-of-workflows.mdx index 9a6b0fa4e37da45..cdf13f5c3b38926 100644 --- a/src/content/docs/workflows/build/rules-of-workflows.mdx +++ b/src/content/docs/workflows/build/rules-of-workflows.mdx @@ -459,7 +459,7 @@ When creating multiple Workflow instances, use the [`createBatch`](/workflows/bu ```ts export default { async fetch(req: Request, env: Env): Promise { - let instances = [{"id": "user1", "params": {"name": "John"}}, {"id": "user2", "params": {"name": "Jane"}}, {"id": "user3", "params": {"name": "Alice"}}, {"id": "user4", "params": {"name": "Bob"}}]; + let instances = [{ id: "order-1001", params: { totalUsd: 29.99 }}, { id: "order-1002", params: { totalUsd: 9.49 }}]; // 🔴 Bad: Create them one by one, which is more likely to hit creation rate limits. for (let instance of instances) { From e8cf52891096d47e54e4c79555e409c2fd7137b1 Mon Sep 17 00:00:00 2001 From: Jun Lee Date: Tue, 12 Aug 2025 09:57:43 +0100 Subject: [PATCH 2/4] Triggering GH compiles --- src/content/docs/workflows/build/rules-of-workflows.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/workflows/build/rules-of-workflows.mdx b/src/content/docs/workflows/build/rules-of-workflows.mdx index cdf13f5c3b38926..d7ab1d87565cd81 100644 --- a/src/content/docs/workflows/build/rules-of-workflows.mdx +++ b/src/content/docs/workflows/build/rules-of-workflows.mdx @@ -461,7 +461,7 @@ export default { async fetch(req: Request, env: Env): Promise { let instances = [{ id: "order-1001", params: { totalUsd: 29.99 }}, { id: "order-1002", params: { totalUsd: 9.49 }}]; - // 🔴 Bad: Create them one by one, which is more likely to hit creation rate limits. + // 🔴 Bad: Create them one by one, which is more likely to hit creation rate limits. for (let instance of instances) { await env.MY_WORKFLOW.create({ id: instance.id, From 7952752be29991a0c72d97441beff66f0810baf6 Mon Sep 17 00:00:00 2001 From: Jun Lee Date: Tue, 12 Aug 2025 09:57:59 +0100 Subject: [PATCH 3/4] Undoing redundant change --- src/content/docs/workflows/build/rules-of-workflows.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/workflows/build/rules-of-workflows.mdx b/src/content/docs/workflows/build/rules-of-workflows.mdx index d7ab1d87565cd81..cdf13f5c3b38926 100644 --- a/src/content/docs/workflows/build/rules-of-workflows.mdx +++ b/src/content/docs/workflows/build/rules-of-workflows.mdx @@ -461,7 +461,7 @@ export default { async fetch(req: Request, env: Env): Promise { let instances = [{ id: "order-1001", params: { totalUsd: 29.99 }}, { id: "order-1002", params: { totalUsd: 9.49 }}]; - // 🔴 Bad: Create them one by one, which is more likely to hit creation rate limits. + // 🔴 Bad: Create them one by one, which is more likely to hit creation rate limits. for (let instance of instances) { await env.MY_WORKFLOW.create({ id: instance.id, From 94f377967310f7e95ebc44a16c06fda6c43e479d Mon Sep 17 00:00:00 2001 From: Jun Lee Date: Tue, 12 Aug 2025 11:35:57 +0100 Subject: [PATCH 4/4] Update src/content/docs/workflows/build/rules-of-workflows.mdx --- src/content/docs/workflows/build/rules-of-workflows.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/workflows/build/rules-of-workflows.mdx b/src/content/docs/workflows/build/rules-of-workflows.mdx index cdf13f5c3b38926..d7450985ac94c19 100644 --- a/src/content/docs/workflows/build/rules-of-workflows.mdx +++ b/src/content/docs/workflows/build/rules-of-workflows.mdx @@ -459,7 +459,7 @@ When creating multiple Workflow instances, use the [`createBatch`](/workflows/bu ```ts export default { async fetch(req: Request, env: Env): Promise { - let instances = [{ id: "order-1001", params: { totalUsd: 29.99 }}, { id: "order-1002", params: { totalUsd: 9.49 }}]; + let instances = [{id: "user1", params: {name: "John"}}, {id: "user2", params: {name: "Jane"}}, {id: "user3", params: {name: "Alice"}}, {id: "user4", params: {name: "Bob"}}]; // 🔴 Bad: Create them one by one, which is more likely to hit creation rate limits. for (let instance of instances) {