It seems that the logs don't get send to the tail worker.
It seems that the logs don't get send to the tail worker.
step.do for retries but then I could really quickly hit 1024 steps limit. Maybe I could invoke separate workflow in the inner loop to just handle processing the event? But then my generateEventSummary might throw 429 error. I guess sending queue message for every event and handling it in separate worker might be a better approach? What would be the "idiomatic" CF approach? Thanks!.terminate() method on a workflow instance implemented at the moment?<MY_WORKER>/production/settings#bindings then workflows are not shown. I was going to add them manually as a service, but am I going to have to do this for every deployment?events and i have been inserted already, so that way on retry you would just check the kv for where to start. - depending on db you might also want to do all the inserts as a batch after events.length has been processed, which would reduce the number of kv writes to track i.await env.MY_WORKFLOW.createBatch(listOfInstances); it's returning [{"fetcher":{}}] instead of WorkflowInstances?errored is both a terminal and transient state. There should be a separate state signalling the workflow has exhausted all retries.await step.do("process-events", async () => {
const eventsGroupedBySomething = [[], [], [], [], [], []]; // potentially ~10 groups with 100s of events each
for (const events of eventsGroupedBySomething) {
for (let i = 0; i < events.length; i++) {
const event = events[i]!;
const { embedding, summary } = await generateEventSummary(event);
await db
.insert(schema.eventVector)
.values({ id: nanoid(), eventId: event.id, embedding, summary });
}
}
});Scope failed estate/banana--prod/worker/worker
Scope is in error, skipping finalize
Scope failed estate/banana--prod/worker
Scope failed estate/banana--prod/worker
Scope is in error, skipping finalize
17 | errorData;
18 | /**
19 | * Create a new CloudflareApiError
20 | */
21 | constructor(message, response, errorData) {
22 | super(message);
^
CloudflareApiError: Error 401 create workflow 'banana--prod--GENERIC_BROWSER_WORKFLOW': Authentication error
status: 401,
statusText: "Unauthorized",
errorData: [
[Object ...]
],
at new CloudflareApiError (/home/runner/work/monorepo/monorepo/node_modules/.pnpm/alchemy@0.20.1_@ai-sdk+openai-compatible@0.2.13_zod@3.25.17__@ai-sdk+openai@1.1.5_zod@3_72bf5a10489ada0d229ba0333e766a7c/node_modules/alchemy/lib/cloudflare/api-error.js:22:9)
at handleApiError (/home/runner/work/monorepo/monorepo/node_modules/.pnpm/alchemy@0.20.1_@ai-sdk+openai-compatible@0.2.13_zod@3.25.17__@ai-sdk+openai@1.1.5_zod@3_72bf5a10489ada0d229ba0333e766a7c/node_modules/alchemy/lib/cloudflare/api-error.js:53:11)
Bun v1.2.15 (Linux x64 baseline)
ELIFECYCLE Command failed with exit code 1.