Would it be safe/recommended to use the following code or would that hit any limit? ```ts const a =
Would it be safe/recommended to use the following code or would that hit any limit?
const a = await this.env.EXTENSION_HANDLER.get('id');
let state = await a.status();
while (state.status !== 'running') {
state = await a.status();
}but we don't want to implement our logic twiceWhy don't you share the workflow logic by abstracting it into a function which can be called by either the Workflow or synchronous endpoint?


wrangler dev --env dev --port 53769 --persist-to=../web-app/.wrangler/state

Instance object, which is not (it has methods). id.id@sentry/cloudflare, but from what I can tell it only provides high level wrappers for fetch requests and pages - I can't figure out how to make a cloudflare logger instance.observability.enabled: true.toml like this:workflow B needs to have a binding in workflow A, where does that binding go? Just another [[workflows]] entry? If so, that seems to fail as it would expect the class_name reference to exist in workflow A's index.
✘ [ERROR] Worker "workflows:workflow-b"'s binding "USER_WORKFLOW" refers to a service "core:user:workflow-b", but no such service is defined.USER_WORKFLOW is not a string that exists in my codebase, at all. NOTE: Found a reference to USER_WORKFLOW in the workers-sdk codebase: https://github.com/cloudflare/workers-sdk/blob/99f802591e65a84f509a03a4071030eb0c6c11ba/packages/miniflare/src/plugins/workflows/index.ts#L77

step.sleep within the step when you get a rate limiting error? with the argument as the future Date?export class HelloWorldWorkflow extends WorkflowEntrypoint {
async run(_: Readonly<WorkflowEvent<unknown>>, step: WorkflowStep) {
while (true) {
try {
await step.do('fetch data', async () => {
await fetch('data url')
})
await step.sleep('wait untill next data', '5 minutes')
} catch {
await step.sleep('handle too many subrequests', '15 minutes')
}
}
}
}// Start workflows
c.env.COVE_WORKFLOW_VIDEO_UPLOAD_STREAM.create({
params: {
videoId: id,
},
});
c.env.COVE_WORKFLOW_VIDEO_TRANSCRIPT.create({
params: {
videoId: id,
},
});for (const lead of leads) {
const result = await Promise.all([step.do('Step 1', async () => {}), step.do('Step 2', async () => {})])
await step.do('callback', async () => { /* callback with a result */})
}[[workflows]]
name = "workflow-a"
binding = "WORKFLOW_A"
class_name = "WorkflowA"
[[workflows]]
name = "workflow-b"
binding = "WORKFLOW_B"
class_name = "WorkflowB"
script_name = "workflow-b"for (const param of params) {
while (true) {
const response = await step.do('<random name>', { /* options to not retry */ }, ...)
if (response.status === 429) {
await step.sleep('ratelimit expires', Number(response.headers.get('X-RateLimit-Reset')) * 1000)
} else {
break
}
}
}