Skip to content

Commit 3fc8ae3

Browse files
authored
Update rules-of-workflows.mdx
1 parent 5952eef commit 3fc8ae3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export default {
297297
async fetch(req: Request, env: Env): Promise<Response> {
298298
// 🔴 Bad: Use an ID that isn't unique across future Workflow invocations
299299
let userId = getUserId(req) // Returns the userId
300-
let instance = await env.MY_WORKFLOW.create({
300+
let badInstance = await env.MY_WORKFLOW.create({
301301
id: userId,
302302
params: payload
303303
});
@@ -308,14 +308,14 @@ export default {
308308
// so that you can track all instances associated with a specific user or merchant.
309309
instanceId = `${getUserId(request)}-${await crypto.randomUUID().slice(0, 6)}`
310310
let { result } = await addNewInstanceToDB(userId, instanceId)
311-
let instance = await env.MY_WORKFLOW.create({
311+
let goodInstance = await env.MY_WORKFLOW.create({
312312
id: userId,
313313
params: payload
314314
});
315315

316316
return Response.json({
317-
id: instance.id,
318-
details: await instance.status(),
317+
id: badInstance.id,
318+
details: await badInstance.status(),
319319
});
320320
},
321321
};

0 commit comments

Comments
 (0)