It comes back with `There are no deployed Workflows in this account`. This is why I thought that you

It comes back with
There are no deployed Workflows in this account
. This is why I thought that you need something more than just the config in
wrangler.toml
for the deployment to work.

As far as I can tell my workflow names match:
[[workflows]].binding
matches what I use for
env.PROCESS_INCOMING_EMAILS_WORKFLOW
as well as what I set on the
Bindings
type. And
[[workflows]].class_name
matches the name of my workflows class export,
ProcessIncomingEmailsWorkflow
.

Can
[[workflows]].name
be any arbitrary name or what should that match?

I'm not sure how the types would affect the runtime bindings and this worker app has many other bindings (KV, queues, AI, etc) which all work.

Here is the relevant code that instantiates the Hono app (it uses the factory setup):

app.ts

import { createFactory } from 'hono/factory';

import { Env } from './types';

export const factory = createFactory<Env>({
  initApp: (app) => {
    app.use(async (c, next) => {
      // Make supabase client available to all requests
      const supabase = createClient(c.env.SUPABASE_URL, c.env.SUPABASE_KEY);
      c.set('supabase', supabase);

      await next();
    });
  },
});

export const app = factory.createApp();


types.ts

import type { Workflow } from '@cloudflare/workers-types';

export type Bindings = {
  // ...other bindings
  PROCESS_INCOMING_EMAILS_WORKFLOW: Workflow;
};

export type Env = {
  Bindings: Bindings;
  Variables: Variables;
};


Do you think the factory setup could be problematic?
Was this page helpful?