From 16fd7cf73821c36ced788ddbceeee7755d3fc0c4 Mon Sep 17 00:00:00 2001 From: Bhanu Prakash Sai Potteri Date: Fri, 22 May 2026 20:02:11 +0530 Subject: [PATCH] Switch workflow identifier to UUID under workflow_uuid --- src/api/viewService.ts | 22 ++++++++++++++-------- src/config.ts | 3 ++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/api/viewService.ts b/src/api/viewService.ts index 170cc34..bf591d2 100644 --- a/src/api/viewService.ts +++ b/src/api/viewService.ts @@ -273,22 +273,28 @@ export interface WorkflowResponse { instance_id?: string; } +// Core-service expects the workflow UUID as `workflow_uuid` — the numeric +// `workflow_id` field was removed when the clone-portable identifier rolled out. export function startWorkflow( - workflowId: string, + workflowUuid: string, activityId: string, data?: Record, ): Promise { - return request("POST", `/app/${APP_ID}/start`, { workflow_id: workflowId, activity_id: activityId, data }); + return request("POST", `/app/${APP_ID}/start`, { + workflow_uuid: workflowUuid, + activity_id: activityId, + data, + }); } export function performActivity( - workflowId: string, + workflowUuid: string, instanceId: string, activityId: string, data?: Record, ): Promise { return request("POST", `/app/${APP_ID}/activity`, { - workflow_id: workflowId, + workflow_uuid: workflowUuid, instance_id: instanceId, activity_id: activityId, data, @@ -296,14 +302,14 @@ export function performActivity( } export function submitForm( - workflowId: string, + workflowUuid: string, activityId: string, formData: Record, instanceId?: string, deviceType = "desktop", ): Promise { return request("POST", `/app/${APP_ID}/form/submit`, { - workflow_id: workflowId, + workflow_uuid: workflowUuid, activity_id: activityId, device_type: deviceType, form_data: formData, @@ -325,9 +331,9 @@ export interface InstanceResponse { updated_at: string; } -export function getInstance(workflowId: string, instanceId: string): Promise { +export function getInstance(workflowUuid: string, instanceId: string): Promise { return request("POST", `/app/${APP_ID}/instance`, { - workflow_id: workflowId, + workflow_uuid: workflowUuid, instance_id: instanceId, }); } diff --git a/src/config.ts b/src/config.ts index 6c8ba32..23bc679 100644 --- a/src/config.ts +++ b/src/config.ts @@ -3,7 +3,8 @@ export const ORG_ID = "43"; export const APP_ID = "164"; -export const WORKFLOW_ID = "29347"; +// Core-service expects the workflow UUID (clone-portable) under `workflow_uuid`. +export const WORKFLOW_ID = "17670bed-d52c-455c-87cd-0c1a34417b4a"; export const ACTIVITY_IDS = { INIT_ACTIVITY: "d951de1f-282f-4156-88c3-5bb3bb60d499", // INIT — Sales Agent captures lead