I deleted a User API Key but it is still working.
I deleted a User API Key but it is still working.
.create() with the whole error being just internal error
500s intermittently with 10001: workflows.api.error.internal_serverinternal error on workflow binding .create() since. However, falling back to the HTTP workflow POST .../{workflow_name}/instances api (with the exact same workflow id + params, it succeeds
waitUntil code? waitUntil, because it garbage collects the state and tears down the execution environment after the Workflow instance is registered but BEFORE the workflow is actually run. The sleep prevents the premature shutdown of the Worker execution context. run method without wrapping it inside a step.do. My examples are zod validation of params or something like const ai = new GoogleGenAI().. I theory I don't want to persist those, I'm fine if they run again on a new try. So would it be best to put them in the global run scope?
.create().create()internal errorinternal error10001workflows.api.error.internal_serverPOST .../{workflow_name}/instanceszodconst ai = new GoogleGenAI()// Worker
ctx.waitUntil(
nonBlockingFunc({ ... })
);
async nonBlockingFunc() {
const workflowInstance = await env.MY_WORKFLOW.create();
// await new Promise((resolve) => setTimeout(resolve, 2000)); // sleep fixes???
return workflowInstance.id;
} .post('/:integration/fetch', zValidator('param', z.object({ integration: z.string().min(1) })), async (ctx) => {
const { integration } = ctx.req.valid('param')
const instance = await ctx.env.HistoryIngestion.create({
id: integration,
params: { integrationId: integration },
})
await ctx.env.Jobs.put(
`workflow:${integration}`,
JSON.stringify({ instance: instance.id, status: 'pending', progress: 0, startedAt: Date.now() }),
)
return ctx.json({ success: true }, 202)
})