MCPcopy
hub / github.com/simstudioai/sim / useDeployWorkflow

Function useDeployWorkflow

apps/sim/hooks/queries/deployments.ts:288–312  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

286 * Invalidates deployment info and versions queries on success.
287 */
288export function useDeployWorkflow() {
289 const queryClient = useQueryClient()
290
291 return useMutation({
292 mutationFn: async ({ workflowId }: DeployWorkflowVariables): Promise<DeployWorkflowResult> => {
293 const data = await requestJson(deployWorkflowContract, {
294 params: { id: workflowId },
295 })
296 return {
297 isDeployed: data.isDeployed ?? false,
298 deployedAt: data.deployedAt ?? undefined,
299 apiKey: data.apiKey ?? undefined,
300 warnings: data.warnings,
301 }
302 },
303 onSettled: (_data, error, variables) => {
304 if (error) {
305 logger.error('Failed to deploy workflow', { error })
306 return invalidateDeploymentQueries(queryClient, variables.workflowId)
307 }
308 logger.info('Workflow deployed successfully', { workflowId: variables.workflowId })
309 return refetchDeploymentBoundary(queryClient, variables.workflowId)
310 },
311 })
312}
313
314/**
315 * Variables for undeploy workflow mutation

Callers 4

DeployModalFunction · 0.90
useDeploymentFunction · 0.90
WorkflowToolDeployBadgeFunction · 0.90
workflow-block.tsxFile · 0.90

Calls 5

requestJsonFunction · 0.90
errorMethod · 0.80
infoMethod · 0.80

Tested by

no test coverage detected