workflow not found debugging 05/05

UI shows so: Following is my wranger.toml parts
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"
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"
same request made locally i get 200: but making the same request to deployed version either through cf web ui or any other means i get hit with workflow not found.
No description
No description
No description
13 Replies
Matt Silverlock
Matt Silverlock•4mo ago
Where is the Worker code that calls the Workflow?
tyx
tyxOP•4mo ago
if (req.method === 'POST') {
try {
const body = await req.json() as Params;
const { docpadSessionId, docpadUserId } = body;

if (!docpadSessionId || !docpadUserId) {
return new Response('invalid request: missing required parameters in request body', { status: 400 });
}

let instance = await env.DOCPAD_SESSION_INIT.create({
// id: 'id-from-your-system-if-needed',
params: {
docpadSessionId,
docpadUserId
},
});
return Response.json({
id: instance.id,
details: await instance.status(),
});
} catch (error: unknown) {
const errorMessage = error instanceof Error ? error.message : 'Unknown error parsing request body';
return new Response(`invalid request: ${errorMessage}`, { status: 400 });
}
}
if (req.method === 'POST') {
try {
const body = await req.json() as Params;
const { docpadSessionId, docpadUserId } = body;

if (!docpadSessionId || !docpadUserId) {
return new Response('invalid request: missing required parameters in request body', { status: 400 });
}

let instance = await env.DOCPAD_SESSION_INIT.create({
// id: 'id-from-your-system-if-needed',
params: {
docpadSessionId,
docpadUserId
},
});
return Response.json({
id: instance.id,
details: await instance.status(),
});
} catch (error: unknown) {
const errorMessage = error instanceof Error ? error.message : 'Unknown error parsing request body';
return new Response(`invalid request: ${errorMessage}`, { status: 400 });
}
}
this lives in the fetch function in the index.ts of the worker^ so the error pops when trying to call
: let instance = await env.DOCPAD_SESSION_INIT.create({
: let instance = await env.DOCPAD_SESSION_INIT.create({
the create method^
Matt Silverlock
Matt Silverlock•4mo ago
This is all in the same script? e.g. the Workflow and the Worker? When you deploy the Worker to prod, do you see the Workflow binding in the output? (paste the output)
tyx
tyxOP•4mo ago
Yes, both are in the same file (index.ts).
Total Upload: 205.41 KiB / gzip: 38.51 KiB
Worker Startup Time: 14 ms
Your Worker has access to the following bindings:
- Workflows:
- DOCPAD_SESSION_INIT: DocpadSessionInit
- R2 Buckets:
- USERFILES: docpad
- AI:
- Name: CF_AI
- Vars:
- TURSO_URL: "libsql://....-1..."
- CF_API_GATEWAY_ID: "do...way"
- TURSO_AUTH_TOKEN: "..."
Uploaded docpad-session-init (8.15 sec)
Deployed docpad-session-init triggers (7.68 sec)
https://docpa..nit......workers.dev
workflow: docpad-session-init
Current Version ID: 9015adec-5dcf-4b14-8e89-548548064349
Total Upload: 205.41 KiB / gzip: 38.51 KiB
Worker Startup Time: 14 ms
Your Worker has access to the following bindings:
- Workflows:
- DOCPAD_SESSION_INIT: DocpadSessionInit
- R2 Buckets:
- USERFILES: docpad
- AI:
- Name: CF_AI
- Vars:
- TURSO_URL: "libsql://....-1..."
- CF_API_GATEWAY_ID: "do...way"
- TURSO_AUTH_TOKEN: "..."
Uploaded docpad-session-init (8.15 sec)
Deployed docpad-session-init triggers (7.68 sec)
https://docpa..nit......workers.dev
workflow: docpad-session-init
Current Version ID: 9015adec-5dcf-4b14-8e89-548548064349
It is working totally as expected when ran locally with remote enabled. This issue is only in the deployed worker. I even tried creating a separte workflow just in case any caching related issue. Do you suggest creating a totally new worker? (I've tried too many things but this) I can see the binding clearly in the UI both sides but in the playground and any other way I trigger the worker, I am hit by the oof 400 Just tried with a fresh worker and a fresh workflow, same results. (I am on the free plan, does that affect that?)
tyx
tyxOP•4mo ago
No description
tyx
tyxOP•4mo ago
I am able to replicate the same on the starter-worflow template^ workflow*, i just ran it as-is This seems like some issue specifically with my account? @Helpflare any help?
Matt Silverlock
Matt Silverlock•4mo ago
What is your account ID? I can't reproduce this with the workflows-starter at all (unmodified).
tyx
tyxOP•4mo ago
Hi @Matt Silverlock , thankyou so much for trying to help me out here! I have a demo with possibly the first customer today. getting this resolved will help immensely! but otherwise no hurry 🙂 Here's my acc id: 5b9c71dd3424b51c6f85e6a1cf6ccb70
Diogo Ferreira
Diogo Ferreira•4mo ago
Hi @tyx . Can you please clarify this statement? Workflows are not capable with remote development. Ok! I believe we found the "issue" You are trying to access the related Worker from the edit view inside dash/cf-ui. This space does not support Workflows, as of this moment. Can you please try to call the Worker directly? Either via curl command or from the Visit link?
raff
raff•4mo ago
Hi @Diogo Ferreira - I have exactly the same issue with a deployed workflow. Workflow lives inside of the same worker, it appears in the dashboard and build logs shows the binding. But when calling the worker to create the workflow, it's not working and I get the workflow not found error. Account 7ab19bb7db69dd2f296919bcee0c6539 Redeploying fixed the issue on our end.
scook
scook•4mo ago
@Diogo Ferreira Based on what @tyx and @raff have said, it seems we've all been running into the same issue: When introducing a new workflow that is bound to the same worker that invokes it, it will fail with the "workflow not found" error. It will continue to fail until you redeploy the worker (with no relevant changes). Then the issue magically goes away. This has happened to me multiple times now.
Diogo Ferreira
Diogo Ferreira•4mo ago
Hummm. Thank you for reporting
scook
scook•4mo ago
@Diogo Ferreira Is there a way to follow this issue? The error has resurfaced on a later deploy, and it's been affecting our development process and breaking our customers. FYI for those in this thread - we have discovered this bug will resurface under certain deployment conditions. We have confirmed that it will at least reoccur when you manually update the worker's environment variables in the Cloudflare dashboard (which triggers a redeploy). Posted here: https://discord.com/channels/595317990191398933/1371506630843175105/1371518511079227483

Did you find this page helpful?