I would love to see a API to get the current limit usage dynamically (within a worker for example th
I would love to see a API to get the current limit usage dynamically (within a worker for example the amount of subrequests done)
cf.worker.upstream_zone to identify if the request comes from a Worker but I noticed that this value is empty when the request is from a Workflow. I'm using this to allow requests to a host only to subrequests from my own workers (and thus Workflows)upstream_zone? Well, if it's expected is ok, I can still match them with my workers.dev domain, thanks a lot!step.sleep is a max duration of 365 days. Is waitForEvent also that long? Does it have a default timeout if I do not specify one? Or will it literally just wait until the end of time?sleepwhile (condition) { await step.do(...) } will block on each await before it iterates.

waiting state (following your example, sleeping for 30 days), it does not count towards the concurrent invocation limit - only instances with a running state will count towards the limit✘ [ERROR] TypeError: Cannot read properties of undefined (reading 'Symbol(Symbol.dispose)')
at InstanceImpl.sendEvent
(file:///Users/cade/Projects/api/node_modules/miniflare/dist/src/workers/workflows/wrapped-binding.worker.js:57:36)app.post(
"/webhooks/modal/document-parsed",
zValidator(
"json",
z.object({
documentId: z.string(),
instanceId: z.string(),
markdown: z.string(),
siteId: z.string(),
}),
),
async (c) => {
const { documentId, instanceId, markdown, siteId } = c.req.valid("json");
const instance = await c.env.DOCUMENT_WORKFLOW.get(instanceId);
const key = `sites/${siteId}/files/${documentId}.md`;
await c.env.R2.put(key, markdown, {
httpMetadata: { contentType: "text/markdown" },
});
await instance.sendEvent({
type: WorkflowEventType.DocumentParsed,
payload: { markdownFileKey: key },
});
return c.json({ status: "ok" });
},
);The execution of the Workflow instance was terminated, as a step threw an NonRetryableError and it was not handledwaitingrunningthrow new NonRetryableError("File too big!")