You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/sim/lib/webhooks/utils.ts
+14-53Lines changed: 14 additions & 53 deletions
Original file line number
Diff line number
Diff line change
@@ -698,7 +698,7 @@ export async function executeWorkflowFromPayload(
698
698
workflowVariables
699
699
)
700
700
701
-
// Set up logging on the executor
701
+
// Set up logging on the executor
702
702
loggingSession.setupExecutor(executor)
703
703
704
704
// Log workflow execution start time for tracking
@@ -1432,45 +1432,6 @@ export async function fetchAndProcessAirtablePayloads(
1432
1432
/**
1433
1433
* Process webhook verification and authorization
1434
1434
*/
1435
-
/**
1436
-
* Handle Microsoft Teams webhooks with immediate acknowledgment
1437
-
*/
1438
-
asyncfunctionprocessMicrosoftTeamsWebhook(
1439
-
foundWebhook: any,
1440
-
foundWorkflow: any,
1441
-
input: any,
1442
-
executionId: string,
1443
-
requestId: string
1444
-
): Promise<NextResponse>{
1445
-
logger.info(
1446
-
`[${requestId}] Acknowledging Microsoft Teams webhook ${foundWebhook.id} and executing workflow ${foundWorkflow.id} asynchronously (Execution: ${executionId})`
1447
-
)
1448
-
1449
-
// Execute workflow asynchronously without waiting for completion
1450
-
executeWorkflowFromPayload(
1451
-
foundWorkflow,
1452
-
input,
1453
-
executionId,
1454
-
requestId,
1455
-
foundWebhook.blockId
1456
-
).catch((error)=>{
1457
-
// Log any errors that occur during async execution
1458
-
logger.error(
1459
-
`[${requestId}] Error during async workflow execution for webhook ${foundWebhook.id} (Execution: ${executionId})`,
1460
-
error
1461
-
)
1462
-
})
1463
-
1464
-
// Return immediate acknowledgment for Microsoft Teams
1465
-
returnNextResponse.json(
1466
-
{
1467
-
type: 'message',
1468
-
text: 'Sim Studio',
1469
-
},
1470
-
{status: 200}
1471
-
)
1472
-
}
1473
-
1474
1435
/**
1475
1436
* Handle standard webhooks with synchronous execution
1476
1437
*/
@@ -1494,8 +1455,18 @@ async function processStandardWebhook(
1494
1455
)
1495
1456
1496
1457
// Since executeWorkflowFromPayload handles logging and errors internally,
1497
-
// we just need to return a standard success response for synchronous webhooks.
1498
-
// Note: The actual result isn't typically returned in the webhook response itself.
1458
+
// we just need to return a success response for synchronous webhooks.
1459
+
// Microsoft Teams requires a specific response format.
0 commit comments