diff --git a/packages/server/src/automations/triggers.ts b/packages/server/src/automations/triggers.ts index 3336211c5d..08e3199a11 100644 --- a/packages/server/src/automations/triggers.ts +++ b/packages/server/src/automations/triggers.ts @@ -112,7 +112,6 @@ export async function externalTrigger( const data: AutomationData = { automation, event: params as any } if (getResponses) { - await context.ensureSnippetContext() data.event = { ...data.event, appId: context.getAppId(), diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index a4938bb138..4e33fadce6 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -625,6 +625,7 @@ export async function executeInThread(job: Job) { }) return await context.doInAppContext(appId, async () => { + await context.ensureSnippetContext() const envVars = await sdkUtils.getEnvironmentVariables() // put into automation thread for whole context return await context.doInEnvironmentContext(envVars, async () => {