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

Function executeRedeploy

apps/sim/lib/copilot/tools/handlers/deployment/deploy.ts:765–836  ·  view source on GitHub ↗
(
  params: { workflowId?: string; versionDescription?: string; versionName?: string },
  context: ExecutionContext
)

Source from the content-addressed store, hash-verified

763}
764
765export async function executeRedeploy(
766 params: { workflowId?: string; versionDescription?: string; versionName?: string },
767 context: ExecutionContext
768): Promise<ToolCallResult> {
769 try {
770 const workflowId = params.workflowId || context.workflowId
771 if (!workflowId) {
772 return { success: false, error: 'workflowId is required' }
773 }
774 const versionDescription = params.versionDescription?.trim()
775 if (!versionDescription) {
776 return {
777 success: false,
778 error:
779 'versionDescription is required. Provide a concise summary of what changed in this deployment version (call diff_workflows with ref1 "live" and ref2 "draft" if unsure what changed).',
780 }
781 }
782 const versionName = params.versionName?.trim()
783 if (!versionName) {
784 return {
785 success: false,
786 error:
787 'versionName is required. Provide a short human-readable label for this deployment version.',
788 }
789 }
790 await ensureWorkflowAccess(workflowId, context.userId, 'admin')
791
792 const result = await performFullDeploy({
793 workflowId,
794 userId: context.userId,
795 versionDescription,
796 versionName,
797 })
798 if (!result.success) {
799 return { success: false, error: result.error || 'Failed to redeploy workflow' }
800 }
801 const baseUrl = getBaseUrl()
802 const apiEndpoint = buildWorkflowApiEndpoint(baseUrl, workflowId)
803 const apiConfig = buildWorkflowApiConfig(baseUrl, apiEndpoint)
804 const apiExamples = buildWorkflowApiExamples(baseUrl, apiEndpoint)
805 return {
806 success: true,
807 output: {
808 workflowId,
809 isDeployed: true,
810 deployedAt: result.deployedAt || null,
811 version: result.version,
812 apiEndpoint,
813 baseUrl,
814 deploymentType: 'api',
815 deploymentStatus: {
816 api: {
817 isDeployed: true,
818 endpoint: apiEndpoint,
819 deployedAt: result.deployedAt || null,
820 version: result.version,
821 },
822 },

Callers

nothing calls this directly

Calls 7

ensureWorkflowAccessFunction · 0.90
performFullDeployFunction · 0.90
getBaseUrlFunction · 0.90
toErrorFunction · 0.90
buildWorkflowApiEndpointFunction · 0.85
buildWorkflowApiConfigFunction · 0.85
buildWorkflowApiExamplesFunction · 0.85

Tested by

no test coverage detected