Known issue! Working on fixing.
Known issue! Working on fixing.
Workflow.run() function ina try / catch block? BigInt? Uncaught (in promise) TypeError: Do not know how to serialize a BigIntwaitForEvent in terms of promises?Promise.race likePromise.all would also work? bunchOfWaitForEvntsbunchOfWaitForEvntsinstance.sendEvent() with their ID.Promise.all works - we don’t change how the standard promise handling works. sendEvent is still a sub-request though.is still a sub-request thoughsendEvent
.sendEvent (with unique Ids)Error: (workflow.invalid_event_type) Provided event type is invalid, and it was because it doesn't work with long-ish event names. I was using a UUID as the event name, and it wasn't working...step.waitForEvent("name", { type: "here" }) instance.sendEvent({ type: "here" }), that's where it was throwing the errorqueued status foreverNonRetryableError 
steps.do pulls the data from a cache that Cloudflare has set up. fnd fails, the following will happen:fna and fnc will both rerun. They better be idempotent.fnb will not rerun because it was pulled from the workflow cache.fnd will still have access to a, b, and c but a and c are fresh data whereas b was pulled from cache.
wrangler workflows instances describe and I can't see the log messages there.Workflow.run()BigIntUncaught (in promise) TypeError: Do not know how to serialize a BigIntPromise.racebunchOfWaitForEvntsbunchOfWaitForEvntsinstance.sendEvent().sendEventError: (workflow.invalid_event_type) Provided event type is invalidstep.waitForEvent("name", { type: "here" })instance.sendEvent({ type: "here" })queuedNonRetryableErrorsteps.dofndfndfnafncfnb async run(context: WorkflowEvent<MyParams>, step: WorkflowStep): Promise<void> {
const workflowId = context.instanceId;
const params = context.payload;
console.log(`Workflow ${workflowId} started with params:`, [...Object.keys(params)]);
try {
// Step 1: Example
const processedData = await step.do('process-data', async () => {
console.log(`[${workflowId}] Step 1: Processing data...`);
// Simulate work - replace with actual logic
await new Promise(resolve => setTimeout(resolve, 1000)); // Simulate delay
console.log(`[${workflowId}] Step 1: Processing complete.`);
return true;
});wrangler workflows instances describelet value = Promise.race([
step.waitForEvent("payment success", { type: "payment-success-webhook", timeout: "4 hours" ),
step.waitForEvent("payment failure", { type: "payment-failure-webhook", timeout: "4 hours" ),
])const longArray: { id: string, data: any }[] = [
/* imagine a lot of things here */
...
]
const bunchOfWaitForEvnts = longArray.map(item => step.waitForEvent("sub-workflow", { type: `id-${item.id}`, timeout: "4 hours" ))
const aggregatedResponses = Promise.all(bunchOfWaitForEvnts)
await step.do('do-more-stuff-with-aggregated-responses', async () => { /* */})const a = fna()
const b = step.do("fnb", fnb())
const c = fnc(b)
const d = step.do("fnd", fnd(a,b,c))