@@ -201,12 +201,14 @@ export const KnownBindingSchema = z.discriminatedUnion("type", [
201201 WorkerBindingSchema ,
202202 z . strictObject ( { type : z . literal ( "worker-loader" ) } ) ,
203203 // TODO: support Workflows
204- // z.strictObject({
205- // type: z.literal("workflow"),
206- // workerName: z.string(),
207- // exportName: z.string(),
208- // remote: z.boolean().optional(),
209- // }),
204+ // (MAY HAVE TO REVERT PARTIALLY OR PRETEND IT IS A MINIFLARE ONLY BINDING)
205+ z . strictObject ( {
206+ type : z . literal ( "workflow" ) ,
207+ name : z . string ( ) ,
208+ workerName : z . string ( ) ,
209+ exportName : z . string ( ) ,
210+ remote : z . boolean ( ) . optional ( ) ,
211+ } ) ,
210212] ) ;
211213
212214export const UnsafeBindingSchema = z . looseObject ( {
@@ -340,6 +342,14 @@ export const WorkerEntrypointExportSchema = z.strictObject({
340342 cache : z . strictObject ( { enabled : z . boolean ( ) } ) . optional ( ) ,
341343} ) ;
342344
345+ // Exported for Miniflare's `MiniflareExportSchema`. Not yet added to the shared
346+ // `ExportSchema` union / public `Export` type — see "TODO: support Workflows".
347+ export const WorkflowExportSchema = z . strictObject ( {
348+ type : z . literal ( "workflow" ) ,
349+ name : z . string ( ) ,
350+ limits : z . strictObject ( { steps : z . number ( ) . optional ( ) } ) . optional ( ) ,
351+ } ) ;
352+
343353export const ExportSchema = z . union ( [
344354 DurableObjectCreatedExportSchema ,
345355 DurableObjectDeletedExportSchema ,
@@ -348,11 +358,6 @@ export const ExportSchema = z.union([
348358 DurableObjectExpectingTransferExportSchema ,
349359 WorkerEntrypointExportSchema ,
350360 // TODO: support Workflows
351- // z.strictObject({
352- // type: z.literal("workflow"),
353- // name: z.string(),
354- // limits: z.strictObject({ steps: z.number().optional() }).optional(),
355- // }),
356361] ) ;
357362
358363const LimitsSchema = z . strictObject ( {
0 commit comments