MCPcopy Index your code
hub / github.com/simstudioai/sim / notifyWorkflowArchived

Function notifyWorkflowArchived

apps/sim/lib/workflows/lifecycle.ts:31–50  ·  view source on GitHub ↗
(workflowId: string, requestId: string)

Source from the content-addressed store, hash-verified

29}
30
31async function notifyWorkflowArchived(workflowId: string, requestId: string): Promise<void> {
32 try {
33 const socketResponse = await fetch(`${getSocketServerUrl()}/api/workflow-deleted`, {
34 method: 'POST',
35 headers: {
36 'Content-Type': 'application/json',
37 'x-api-key': env.INTERNAL_API_SECRET,
38 },
39 body: JSON.stringify({ workflowId }),
40 })
41
42 if (!socketResponse.ok) {
43 logger.warn(`[${requestId}] Failed to notify Socket.IO about archived workflow ${workflowId}`)
44 }
45 } catch (error) {
46 logger.warn(`[${requestId}] Error notifying Socket.IO about archived workflow ${workflowId}`, {
47 error,
48 })
49 }
50}
51
52async function cleanupExternalWebhooksForWorkflow(
53 workflowId: string,

Callers 1

archiveWorkflowFunction · 0.85

Calls 2

getSocketServerUrlFunction · 0.90
warnMethod · 0.65

Tested by

no test coverage detected