© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•17mo ago•
3 replies
Web Bae

Fetch inside a scheduled Cron Job

Hello,

I have a worker that I want to use to ping another worker endpoint every day.

When I run the
dev
dev
server it works great but when I deploy I get 404.

Here's an example code block:

import { Env, Hono } from "hono";

const app = new Hono();

app.get("/", (c) => {
  return c.text("Hello Hono!");
});

export default {
  async scheduled(
    event: ScheduledEvent,
    env: Env,
    ctx: ExecutionContext
  ): Promise<void> {
    console.log("Scheduled Event Triggered at:", new Date().toISOString());

    const response = await fetch("example.worker.dev/my-endpoint");
  },

  async fetch(request: Request, env: Env) {
    return await app.fetch(request, env);
  },
};
import { Env, Hono } from "hono";

const app = new Hono();

app.get("/", (c) => {
  return c.text("Hello Hono!");
});

export default {
  async scheduled(
    event: ScheduledEvent,
    env: Env,
    ctx: ExecutionContext
  ): Promise<void> {
    console.log("Scheduled Event Triggered at:", new Date().toISOString());

    const response = await fetch("example.worker.dev/my-endpoint");
  },

  async fetch(request: Request, env: Env) {
    return await app.fetch(request, env);
  },
};


Am I not using this right? I looked into ctx.waitUntil but that didn't help either.

Thank you!
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Trying to fetch a worker endpoint inside a scheduled trigger
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3w ago
CRON job CPU limit
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Is waituntil() necessary in scheduled cron?
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
17mo ago
Set a wp cron job on workers
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
16mo ago