core icon indicating copy to clipboard operation
core copied to clipboard

Have to manually set up triggers in Cloudflare worker settings to run the scheduled tasks

Open agalloch21 opened this issue 4 months ago • 2 comments

I tried to run a scheduled task in an nuxt app by following this doc.

Here is the config:

export default defineNuxtConfig({
  nitro: {
      preset: 'cloudflare-module',
      experimental: {
        tasks: true
      },
      cloudflare: {
        deployConfig: true,
        wrangler: {
          triggers: {
            crons: ['* * * * *']
          },
        }
      },
      scheduledTasks: {
        '* * * * *': ['some-task']
      }
    },
})

Env: Nuxt 3.17.3 with Nitro 2.11.12

After deploying with NuxtHub, I had to go to Cloudflare and set up the exact same trigger in the settings to make the task work. Not a big deal, just sharing in case someone else runs into the same issue.

agalloch21 avatar Aug 19 '25 20:08 agalloch21

Have you found a way to fix this directly in nuxt with nuxthub without having to put create them manually in cloudflare interface? @agalloch21

luminous8 avatar Oct 01 '25 09:10 luminous8

Have you found a way to fix this directly in nuxt with nuxthub without having to put create them manually in cloudflare interface? @agalloch21

Nope. But creating a new worker directly in cloudflare and linking it with the nuxt repo on github can do the trick.

agalloch21 avatar Oct 01 '25 18:10 agalloch21