npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

workflow-cron-start

v1.0.6

Published

Start workflows on a cron schedule with the Workflow Dev Kit

Readme

workflow-cron-start

Start Vercel Workflows on a cron schedule using cronStart() and a build-time wrapper pipeline.

What this does

  • cronStart(workflow, args, options) — schedules a workflow on a cron expression. Calls are rewritten at build time to run a generated “scheduler” workflow (cron sleep → run your workflow → repeat).
  • cronEnd(runId) — cancels a run started with cronStart.
  • Next.js — use withCronWorkflow in next.config (instead of withWorkflow alone) so the loader can transform cronStart() and Turbopack matches files that only import cronStart (no "use workflow" in the same file).

Next.js setup (required)

// next.config.ts
import type { NextConfig } from "next"
import { withCronWorkflow } from "workflow-cron-start/next"

const nextConfig: NextConfig = { /* … */ }

export default withCronWorkflow(nextConfig)

Peer dependencies: next and workflow.

Installation

npm install workflow-cron-start

Quick start

// app/api/run-report/route.ts
import { cronStart } from "workflow-cron-start"
import { sendReport } from "@/workflows/send-report"

export async function POST() {
  const run = await cronStart(sendReport, ["weekly"], {
    cron: "0 9 * * *",
    timezone: "America/New_York",
  })
  return Response.json({ runId: run.runId })
}

Your workflow module should use "use workflow" as usual; cronStart wires it to the generated cron wrapper.

API

cronStart(workflow, args, options)

| Argument | Description | |----------|-------------| | workflow | The workflow function to run on each tick | | args | Tuple of arguments passed to the workflow each time | | options | CronOptions (see below) |

Returns Promise<CronStartResult> with runId.

cronEnd(runId)

Cancels a cron scheduler run previously returned from cronStart.

CronOptions

| Property | Type | Required | Description | |----------|------|----------|-------------| | cron | string | Yes | Cron expression | | timezone | string | No | IANA zone (recommended) | | onError | "continue" | "stop" | No | Default "continue" |

Re-exports

cronSleep / CronSleepOptions from workflow-cron-sleep (used by generated code).

Timezone

If you omit timezone, behavior follows the generated scheduler and your deployment environment. For predictable schedules, set an explicit IANA timezone.

Error handling

Use onError: "stop" in CronOptions if the cron loop should stop when the inner workflow throws; default is "continue".

Cron expression reference

| Expression | Meaning | |------------|---------| | 0 9 * * * | Every day at 9:00 AM | | 30 8 * * 1 | Every Monday at 8:30 AM | | 0 0 1 * * | First day of month at midnight | | 0 */2 * * * | Every 2 hours | | 0 9 * * 1-5 | Weekdays at 9:00 AM |

Troubleshooting

If you see cronStart() was not transformed at build time, confirm withCronWorkflow wraps your Next config and restart the dev server or rebuild.

Requirements

  • workflow (Vercel Workflows SDK)
  • next (for workflow-cron-start/next and the loader)
  • workflow-cron-sleep (dependency of this package)

License

MIT