Pretty sure Workflows is built off of Queues. So read docs of both and weigh up pros and cons of you
Pretty sure Workflows is built off of Queues. So read docs of both and weigh up pros and cons of your use case - e.g. auto retries etc

Error: (workflow.not_found) Provided Workflow does not exist when deployed but If I run it locally (but on remote mode) i detects the workflow and triggers it successfully. (i've tried re-deploying without success)


[[workflows]] to my toml file?isolatedStorage otherwise it was complaining about not being able to find my imported Workflow class to bind.workerd/jsg/util.c++:320: error: e = kj/table.c++:49: failed: inserted row already exists in table
singleWorkfer: true got it working, so it must be that the workflows each spin up their own worker, and try to initialize something for each test?

createBatch to do 100 at a time within each of the initial 31. The total amount gets queued up very quickly. The graph above is the steps processing inside those from my understanding. ratelimit and a workflow worker?smart placement)


name = "docpad-session-init"
main = "src/index.ts"
compatibility_date = "2024-10-22"
compatibility_flags = ["nodejs_compat"]
[[workflows]]
binding = "DOCPAD_SESSION_INIT"
name = "docpad-session-init"
class_name = "DocpadSessionInit"import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config';
export default defineWorkersConfig({
test: {
poolOptions: {
workers: {
isolatedStorage: false,
wrangler: { configPath: './wrangler.toml' },
},
poolMatchGlobs: [],
},
maxConcurrency: 1,
},
})import { createExecutionContext } from "cloudflare:test";
import { describe, it, expect } from "vitest";
describe("test", () => {
it('test', () => {
// referencing something from cloudflare:test
const ctx = createExecutionContext()
expect(2).toBe(2)
})
})// elsewhere, as a helper - e.g. on the Workflow class
async function getDB(db, this.env) {
if (!db) {
db = // create a new connection
}
return db
}[[unsafe.bindings]]
name = "RATE_LIMIT_MEASUREMENT_GUEST"
type = "ratelimit"
namespace_id = "1000"
simple = { limit = 3, period = 60 }export default class WorkflowsService extends WorkerEntrypoint<CloudflareEnv> {
// ...
async createWorkflow(payload: Params) {
// check if the user has exceeded the limit
const RATE_LIMITER = this.env.RATE_LIMIT_MEASUREMENT_GUEST;
const { success } = await RATE_LIMITER.limit({
key: payload.userIdOrIpAddress,
});
// success locally works as expected but on production I can x3/x4 the limit and still success=true (all sending the exact same
// Something in one of these two steps causes the workflow to show outcome of "exception" and
// level of "error". What?
const { foo, bar } = await step.do("test", async () => {
const foo = "hello";
const bar = "world";
return {
foo,
bar,
};
});
await step.do("test", async () => {
return foo + bar;
});
// This will not cause an error...most the time...when it's the *only* step in the workflow.
await step.do("test", async () => {
return "foooo";
});