Ok it means every step will get 128 MiB or a whole workerflow ?
Ok it means every step will get 128 MiB or a whole workerflow ?
step.sleep duration is in seconds if it's a number but it seems to me that it's actually ms?Worker "workflows:AfterContractActivated-development"'s binding "USER_WORKFLOW" refers to a service "core:user:delivery-development", but no such service is defined.onError callback i could pass where i could set some custom logic to try when a step errors. E.g.:onError callback would still have to be treated like another step, but ends up being another not-quite-a-step API with its own semantics.WORKFLOW_SERVICE Env variabe as? 
✘ [ERROR] TypeError: The RPC receiver does not implement the method "createInstance"yieldEvent is outside of a step - meaning that these calls can be repeated multiple times (not sure if that's you want or not)internal error before the workflow tries to execute any steps. Any ideas? 

WorkflowEntrypoint and bindings are accessed via this.env rather than just env^[a-zA-Z0-9_][a-zA-Z0-9-_]*$ (https://developers.cloudflare.com/workflows/reference/limits)5e3dea7b807381cba36b9292bde14920
1ac93aea0842f2d3ef10111b5bf7bb11
npx wrangler types supposed to work for workflows?services = [{ binding = "WORKFLOW_PROCESS_TRANSACTIONS", service = "money" }]wrangler 3.107.3
wrangler workflows instances list <YOUR_WORKFLOW_NAME> | grep "▶ Running" -B1 | grep -Eo '([a-f0-9\-]{36})' | xargs -I {} wrangler workflows instances terminate <YOUR_WORKFLOW_NAME> {} definitly helped me. You can also do xargs -I {} -P 10 sh -c to parallelize
9 running in the screenshot above, no workflows had run in since Friday. Workflow metrics show 0 instances and 0 steps. Please, help!producer worker where you send the events, and it then places them into the queue.main step, which contains all the rest of the steps as substep. That is - it iterates over the batch of received events one by one and all the rest is the same as before. 
step.sleepWorker "workflows:AfterContractActivated-development"'s binding "USER_WORKFLOW" refers to a service "core:user:delivery-development", but no such service is defined.onErroronError "services": [
{
"binding": "WORKFLOW_SERVICE",
"service": "wf-portcity-ai"
}
],WORKFLOW_SERVICE✘ [ERROR] TypeError: The RPC receiver does not implement the method "createInstance"yieldEventinternal errorWorkflowEntrypointthis.envenv^[a-zA-Z0-9_][a-zA-Z0-9-_]*$5e3dea7b807381cba36b9292bde149201ac93aea0842f2d3ef10111b5bf7bb11npx wrangler typesservices = [{ binding = "WORKFLOW_PROCESS_TRANSACTIONS", service = "money" }]wrangler 3.107.3interface Env {
SESSION_SECRET: string;
DB: D1Database;
WORKFLOW_PROCESS_TRANSACTIONS: Fetcher;
}wrangler workflows instances list <YOUR_WORKFLOW_NAME> | grep "▶ Running" -B1 | grep -Eo '([a-f0-9\-]{36})' | xargs -I {} wrangler workflows instances terminate <YOUR_WORKFLOW_NAME> {}xargs -I {} -P 10 sh -c9 runningproducerexport class WORKFLOW_WITH_BATCHED_EVENTS extends WorkflowEntrypoint<Env, BatchPayload> {
async run(event: WorkflowEvent<BatchPayload>, step: WorkflowStep) {
// Can access bindings on `this.env`
// Can access params on `event.payload`
const ctx = this.ctx;
const events = event.payload.data;
// THIS IS THE MAIN STEP, WHICH CONTAINS THE ACTUAL SUB-STEPS, WHAT I MENTIONED BEFORE.
const process_events = await step.do("process_events",
async () => {
/// ITERATE OVER THE EVENTS ONE-BY-ONE
for(const key in events){
const e = events[key];
//SUBSTEPS - Process as usual.
const fbcapi = await step.do(`your_substep_name`,
async () => { ... }
)
//.... the rest of your wf logic
}
//...
})
}export class TextGenerator extends WorkflowEntrypoint<CloudflareBindings> {
async run(
event: Readonly<WorkflowEvent<{ prompt: string }>>,
step: WorkflowStep,
) {
const { prompt } = event.payload;
return await step.do(
"generate-text",
{
retries: { limit: 3, delay: 1000, backoff: "exponential" },
onError: async (error, retry) => {
if (error instanceof AITimeoutError) {
// Complex model timed out, try with a faster one first
try {
return await generateText({
model: "gpt-3.5-turbo",
prompt,
timeout: 5000,
});
} catch {
// If faster model fails, retry with original complex model (retry is the original callback in step.do)
return retry();
}
}
throw error;
}
},export class RAGWorkflow {
async run(event, step) {
const { text } = event.params;
const record = await step.do('create database record', async () => {
const query = 'INSERT INTO notes (text) VALUES (?) RETURNING *';
const { results } = await env.DB.prepare(query).bind(text).run();
const record = results[0];
if (!record) throw new Error('Failed to create note');
return record;
});
const embedding = await step.do('generate embedding', async () => {
const embeddings = await env.AI.run('@cf/baai/bge-base-en-v1.5', { text: text });
const values = embeddings.data[0];
if (!values) throw new Error('Failed to generate vector embedding');
return values;
});
await step.do('insert vector', async () => {
return env.VECTOR_INDEX.upsert([
{
id: record.id.toString(),
values: embedding,
},
]);
});
}
}