also, what happens if i reuse a workflow ID? i know i'm not supposed to but...
also, what happens if i reuse a workflow ID? i know i'm not supposed to but...
restart()'ing an instance count to the 100 per 10 second liimit of the Maximum Workflow instance creation rate?console.log messages emitted during that workflow run.`
export abstract class AbstractWorkflow<T, R> extends WorkflowEntrypoint<Env, T> {
protected abstract getName(): string;
protected abstract validateInput(input: T): void;
protected abstract runStep(event: WorkflowEvent<T>, step: WorkflowStep): Promise<R>;
async run(event: WorkflowEvent<T>, step: WorkflowStep): Promise<unknown> {
console.log({
message: `${this.getName()} started.`,
level: "info",
event,
});
try {
this.validateInput(event.payload);
const output = await this.runStep(event, step);
console.log({
message: `${this.getName()} completed.`,
level: "info",
event,
output,
});
return output;
} catch (error) {
console.log({
message: `${this.getName()} failed.`,
level: "error",
event,
error,
});
throw error;
}
}
}

waitForEvent step, but when we use sendEvent in our route to continue the workflow, we are sometimes waiting up to 45 minutes for the workflow to continue. Some extra info:sendEvent is being called is deployed to a Cloudflare Worker.sendEvent is called, and the types match.waitForEvent step has only been waiting for a few minutes I haven’t recreated the issue yet, but when the waitForEvent step has been waiting 20+ minutes we run into the issue the majority of the time.workflows-starter@0.0.1 deploy
wrangler deploy
Known issue: Restarting a Workflow via the restart() method is not currently supported and will throw an exception (error).restart()`
export abstract class AbstractWorkflow<T, R> extends WorkflowEntrypoint<Env, T> {
protected abstract getName(): string;
protected abstract validateInput(input: T): void;
protected abstract runStep(event: WorkflowEvent<T>, step: WorkflowStep): Promise<R>;
async run(event: WorkflowEvent<T>, step: WorkflowStep): Promise<unknown> {
console.log({
message: `${this.getName()} started.`,
level: "info",
event,
});
try {
this.validateInput(event.payload);
const output = await this.runStep(event, step);
console.log({
message: `${this.getName()} completed.`,
level: "info",
event,
output,
});
return output;
} catch (error) {
console.log({
message: `${this.getName()} failed.`,
level: "error",
event,
error,
});
throw error;
}
}
}
waitForEventwaitForEventwaitForEventsendEventsendEventsendEvent// src/workers/my.worker.ts
import { MyWorkflow } from "../workflows/my.workflow";
export {
MyWorkflow
};
type Bindings = {
MY_WORKFLOW: Workflow;
};
const app = new Hono<{ Bindings: Bindings }>();
app.post('/', async (c) => {
return c.env.MY_WORKFLOW.create(..);
})
export default {
fetch: app.fetch,
};