1+ import type { Span } from '@opentelemetry/api' ;
12import { waitUntil } from '@vercel/functions' ;
23import { WorkflowAPIError } from '@workflow/errors' ;
34import type { World } from '@workflow/world' ;
@@ -11,7 +12,6 @@ import type { Serializable } from '../schemas.js';
1112import { dehydrateStepArguments } from '../serialization.js' ;
1213import * as Attribute from '../telemetry/semantic-conventions.js' ;
1314import { serializeTraceCarrier } from '../telemetry.js' ;
14- import type { Span } from '@opentelemetry/api' ;
1515import { queueMessage } from './helpers.js' ;
1616
1717export interface SuspensionHandlerParams {
@@ -31,7 +31,7 @@ interface ProcessHookParams {
3131 queueItem : HookInvocationQueueItem ;
3232 world : World ;
3333 runId : string ;
34- globalThis : typeof globalThis ;
34+ global : typeof globalThis ;
3535}
3636
3737/**
@@ -41,14 +41,14 @@ async function processHook({
4141 queueItem,
4242 world,
4343 runId,
44- globalThis ,
44+ global ,
4545} : ProcessHookParams ) : Promise < void > {
4646 try {
4747 // Create hook in database
4848 const hookMetadata =
4949 typeof queueItem . metadata === 'undefined'
5050 ? undefined
51- : dehydrateStepArguments ( queueItem . metadata , globalThis ) ;
51+ : dehydrateStepArguments ( queueItem . metadata , global ) ;
5252 await world . hooks . create ( runId , {
5353 hookId : queueItem . correlationId ,
5454 token : queueItem . token ,
@@ -86,7 +86,7 @@ interface ProcessStepParams {
8686 runId : string ;
8787 workflowName : string ;
8888 workflowStartedAt : number ;
89- globalThis : typeof globalThis ;
89+ global : typeof globalThis ;
9090}
9191
9292/**
@@ -98,15 +98,15 @@ async function processStep({
9898 runId,
9999 workflowName,
100100 workflowStartedAt,
101- globalThis ,
101+ global ,
102102} : ProcessStepParams ) : Promise < void > {
103103 const ops : Promise < void > [ ] = [ ] ;
104104 const dehydratedInput = dehydrateStepArguments (
105105 {
106106 args : queueItem . args ,
107107 closureVars : queueItem . closureVars ,
108108 } ,
109- globalThis
109+ global
110110 ) ;
111111
112112 try {
@@ -226,7 +226,7 @@ export async function handleSuspension({
226226 queueItem,
227227 world,
228228 runId,
229- globalThis : suspension . globalThis ,
229+ global : suspension . globalThis ,
230230 } )
231231 )
232232 ) ;
@@ -241,7 +241,7 @@ export async function handleSuspension({
241241 runId,
242242 workflowName,
243243 workflowStartedAt,
244- globalThis : suspension . globalThis ,
244+ global : suspension . globalThis ,
245245 } )
246246 )
247247 ) ,
0 commit comments