Can I get workflow instance id in workflow itself? I want workflow instance id in step of that workf
Can I get workflow instance id in workflow itself? I want workflow instance id in step of that workflow.
event.instanceId (https://developers.cloudflare.com/workflows/build/workers-api/#workflowevent)

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.
export default {
fetch: app.fetch,
async scheduled(controller: ScheduledController, env: Env, ctx: ExecutionContext) {
env.PROCESS_NOTION_STATUS.create();
env.PROCESS_NOTION_RELEASE.create();
},
};let 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))