File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,9 +43,10 @@ Netlify does not run a long-lived worker. It only wakes the runtime.
4343
4444``` ts
4545export default createNetlifyWorkflowSweepHandler ({ runtime: workflowRuntime })
46- export const config = createNetlifyWorkflowSweepConfig ({
46+
47+ export const config: Config = {
4748 schedule: ' */5 * * * *' ,
48- })
49+ }
4950```
5051
5152Each sweep materializes due schedule buckets and starts deterministic workflow
@@ -63,6 +64,10 @@ Examples:
6364The scheduled function is deliberately stateless. If it is delivered late or
6465twice, the runtime/store should claim each bucket once.
6566
67+ The schedule is intentionally exported as a static ` Config ` object, matching the
68+ other scheduled functions in this repo. Netlify's deploy-time scheduled function
69+ scanner must be able to see the cron string without evaluating adapter helpers.
70+
6671## Durable Store
6772
6873Workflow persistence is generic and shared by every workflow in the app. The
Original file line number Diff line number Diff line change 1- import {
2- createNetlifyWorkflowSweepConfig ,
3- createNetlifyWorkflowSweepHandler ,
4- } from '@tanstack/workflow-netlify'
5- import {
6- workflowRuntime ,
7- WORKFLOW_RUNTIME_SWEEP_CRON ,
8- } from '~/utils/workflow-runtime.server'
1+ import type { Config } from '@netlify/functions'
2+ import { createNetlifyWorkflowSweepHandler } from '@tanstack/workflow-netlify'
3+ import { workflowRuntime } from '~/utils/workflow-runtime.server'
94
105export default createNetlifyWorkflowSweepHandler ( {
116 runtime : workflowRuntime ,
@@ -14,6 +9,6 @@ export default createNetlifyWorkflowSweepHandler({
149 maxTimers : 10 ,
1510} )
1611
17- export const config = createNetlifyWorkflowSweepConfig ( {
18- schedule : WORKFLOW_RUNTIME_SWEEP_CRON ,
19- } )
12+ export const config : Config = {
13+ schedule : '*/5 * * * *' ,
14+ }
Original file line number Diff line number Diff line change @@ -7,8 +7,6 @@ import { createDrizzlePostgresWorkflowStore } from '@tanstack/workflow-store-dri
77import { db } from '~/db/client'
88import { createAppWorkflowRegistrations } from '~/utils/workflow-registrations.server'
99
10- export const WORKFLOW_RUNTIME_SWEEP_CRON = '*/5 * * * *'
11-
1210export const workflowExecutionStore = createDrizzlePostgresWorkflowStore ( { db } )
1311
1412export function createAppWorkflowRuntime ( options ?: {
You can’t perform that action at this time.
0 commit comments