Skip to content

Commit 740c64a

Browse files
committed
fix cleanup
1 parent 975e9f3 commit 740c64a

File tree

3 files changed

+4
-18
lines changed

3 files changed

+4
-18
lines changed

apps/sim/app/api/webhooks/trigger/[path]/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ export async function POST(
152152
const response = await queueWebhookExecution(foundWebhook, foundWorkflow, body, request, {
153153
requestId,
154154
path,
155-
executionTarget: 'deployed',
156155
})
157156
responses.push(response)
158157
}

apps/sim/background/webhook-execution.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ import { WebhookAttachmentProcessor } from '@/lib/webhooks/attachment-processor'
1212
import { fetchAndProcessAirtablePayloads, formatWebhookInput } from '@/lib/webhooks/utils.server'
1313
import { executeWorkflowCore } from '@/lib/workflows/executor/execution-core'
1414
import { PauseResumeManager } from '@/lib/workflows/executor/human-in-the-loop-manager'
15-
import {
16-
loadDeployedWorkflowState,
17-
loadWorkflowFromNormalizedTables,
18-
} from '@/lib/workflows/persistence/utils'
15+
import { loadDeployedWorkflowState } from '@/lib/workflows/persistence/utils'
1916
import { getWorkflowById } from '@/lib/workflows/utils'
2017
import { ExecutionSnapshot } from '@/executor/execution/snapshot'
2118
import type { ExecutionMetadata } from '@/executor/execution/types'
@@ -90,7 +87,6 @@ export type WebhookExecutionPayload = {
9087
headers: Record<string, string>
9188
path: string
9289
blockId?: string
93-
executionTarget?: 'deployed' | 'live'
9490
credentialId?: string
9591
credentialAccountUserId?: string
9692
}
@@ -141,20 +137,16 @@ async function executeWebhookJobInternal(
141137
let deploymentVersionId: string | undefined
142138

143139
try {
144-
const useDraftState = payload.executionTarget === 'live'
145-
const workflowData = useDraftState
146-
? await loadWorkflowFromNormalizedTables(payload.workflowId)
147-
: await loadDeployedWorkflowState(payload.workflowId)
140+
const workflowData = await loadDeployedWorkflowState(payload.workflowId)
148141
if (!workflowData) {
149142
throw new Error(
150-
`Workflow state not found. The workflow may not be ${useDraftState ? 'saved' : 'deployed'} or the deployment data may be corrupted.`
143+
'Workflow state not found. The workflow may not be deployed or the deployment data may be corrupted.'
151144
)
152145
}
153146

154147
const { blocks, edges, loops, parallels } = workflowData
155-
// Only deployed executions have a deployment version ID
156148
deploymentVersionId =
157-
!useDraftState && 'deploymentVersionId' in workflowData
149+
'deploymentVersionId' in workflowData
158150
? (workflowData.deploymentVersionId as string)
159151
: undefined
160152

@@ -303,7 +295,6 @@ async function executeWebhookJobInternal(
303295
variables: {},
304296
triggerData: {
305297
isTest: false,
306-
executionTarget: payload.executionTarget || 'deployed',
307298
},
308299
deploymentVersionId,
309300
})
@@ -361,7 +352,6 @@ async function executeWebhookJobInternal(
361352
variables: {},
362353
triggerData: {
363354
isTest: false,
364-
executionTarget: payload.executionTarget || 'deployed',
365355
},
366356
deploymentVersionId,
367357
})
@@ -580,7 +570,6 @@ async function executeWebhookJobInternal(
580570
variables: {},
581571
triggerData: {
582572
isTest: false,
583-
executionTarget: payload.executionTarget || 'deployed',
584573
},
585574
deploymentVersionId,
586575
})

apps/sim/lib/webhooks/processor.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export interface WebhookProcessorOptions {
2424
requestId: string
2525
path?: string
2626
webhookId?: string
27-
executionTarget?: 'deployed' | 'live'
2827
}
2928

3029
function getExternalUrl(request: NextRequest): string {
@@ -942,7 +941,6 @@ export async function queueWebhookExecution(
942941
headers,
943942
path: options.path || foundWebhook.path,
944943
blockId: foundWebhook.blockId,
945-
executionTarget: options.executionTarget,
946944
...(credentialId ? { credentialId } : {}),
947945
}
948946

0 commit comments

Comments
 (0)