diff --git a/packages/payload/src/queues/localAPI.ts b/packages/payload/src/queues/localAPI.ts index 5dbc7d17d36..9b3080b53d1 100644 --- a/packages/payload/src/queues/localAPI.ts +++ b/packages/payload/src/queues/localAPI.ts @@ -1,4 +1,4 @@ -import type { RunningJobFromTask } from './config/types/workflowTypes.js' +import type { BaseJob, RunningJobFromTask } from './config/types/workflowTypes.js' import { createLocalReq, @@ -23,6 +23,7 @@ export const getJobsLocalAPI = (payload: Payload) => ({ // TTaskOrWorkflowlug with keyof TypedJobs['workflows'] removed: task: TTaskOrWorkflowSlug extends keyof TypedJobs['tasks'] ? TTaskOrWorkflowSlug : never workflow?: never + waitUntil?: Date } | { input: TypedJobs['workflows'][TTaskOrWorkflowSlug]['input'] @@ -32,6 +33,7 @@ export const getJobsLocalAPI = (payload: Payload) => ({ workflow: TTaskOrWorkflowSlug extends keyof TypedJobs['workflows'] ? TTaskOrWorkflowSlug : never + waitUntil?: Date }, ): Promise< TTaskOrWorkflowSlug extends keyof TypedJobs['workflows'] @@ -59,7 +61,8 @@ export const getJobsLocalAPI = (payload: Payload) => ({ queue, taskSlug: 'task' in args ? args.task : undefined, workflowSlug: 'workflow' in args ? args.workflow : undefined, - }, + waitUntil: args.waitUntil?.toISOString() ?? undefined, + } as BaseJob, req: args.req, })) as TTaskOrWorkflowSlug extends keyof TypedJobs['workflows'] ? RunningJob