From cbf701fd484dc1f7908059a63d93529a6b043ce7 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Wed, 6 May 2026 20:50:55 -0700 Subject: [PATCH 1/2] fix(workday): correct SOAP service routing and reference types - create-prehire: route Put_Applicant to Recruiting service (was Staffing, where the operation does not exist) - assign-onboarding: use WID for Action_Event_Reference (was Background_Check_ID, wrong identifier domain for hire events) - update-worker block: rewrite labels and wand prompt to match Change_Personal_Information demographic-only scope (prior prompt instructed LLM to emit businessTitle/primaryWorkEmail which the SOAP op rejects) - enrich opaque JSON output descriptions on worker, workers, organizations, compensationPlans --- .../tools/workday/assign-onboarding/route.ts | 2 +- .../api/tools/workday/create-prehire/route.ts | 2 +- apps/sim/blocks/blocks/workday.ts | 51 +++++++++++++------ 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/apps/sim/app/api/tools/workday/assign-onboarding/route.ts b/apps/sim/app/api/tools/workday/assign-onboarding/route.ts index 618a3bd5d36..044dc7c662c 100644 --- a/apps/sim/app/api/tools/workday/assign-onboarding/route.ts +++ b/apps/sim/app/api/tools/workday/assign-onboarding/route.ts @@ -36,7 +36,7 @@ export const POST = withRouteHandler(async (request: NextRequest) => { Onboarding_Plan_Assignment_Data: { Onboarding_Plan_Reference: wdRef('Onboarding_Plan_ID', data.onboardingPlanId), Person_Reference: wdRef('WID', data.workerId), - Action_Event_Reference: wdRef('Background_Check_ID', data.actionEventId), + Action_Event_Reference: wdRef('WID', data.actionEventId), Assignment_Effective_Moment: new Date().toISOString(), Active: true, }, diff --git a/apps/sim/app/api/tools/workday/create-prehire/route.ts b/apps/sim/app/api/tools/workday/create-prehire/route.ts index c7937807040..fae29cdd054 100644 --- a/apps/sim/app/api/tools/workday/create-prehire/route.ts +++ b/apps/sim/app/api/tools/workday/create-prehire/route.ts @@ -48,7 +48,7 @@ export const POST = withRouteHandler(async (request: NextRequest) => { const client = await createWorkdaySoapClient( data.tenantUrl, data.tenant, - 'staffing', + 'recruiting', data.username, data.password ) diff --git a/apps/sim/blocks/blocks/workday.ts b/apps/sim/blocks/blocks/workday.ts index 76d54900afb..d8991d4c521 100644 --- a/apps/sim/blocks/blocks/workday.ts +++ b/apps/sim/blocks/blocks/workday.ts @@ -24,7 +24,7 @@ export const WorkdayBlock: BlockConfig = { { label: 'List Workers', id: 'list_workers' }, { label: 'Create Pre-Hire', id: 'create_prehire' }, { label: 'Hire Employee', id: 'hire_employee' }, - { label: 'Update Worker', id: 'update_worker' }, + { label: 'Update Personal Information', id: 'update_worker' }, { label: 'Assign Onboarding Plan', id: 'assign_onboarding' }, { label: 'Get Organizations', id: 'get_organizations' }, { label: 'Change Job', id: 'change_job' }, @@ -228,31 +228,38 @@ export const WorkdayBlock: BlockConfig = { // Update Worker { id: 'fields', - title: 'Fields (JSON)', + title: 'Personal Information (JSON)', type: 'code', language: 'json', placeholder: - '{\n "businessTitle": "Senior Engineer",\n "primaryWorkEmail": "new@company.com"\n}', + '{\n "Marital_Status_Reference": {\n "ID": { "attributes": { "wd:type": "Marital_Status_ID" }, "$value": "Married" }\n }\n}', + description: + 'Demographic fields supported by Workday Change_Personal_Information (e.g. Date_of_Birth, Gender_Reference, Marital_Status_Reference, Ethnicity_Reference, Citizenship_Status_Reference). Does not update business title or work contact info.', condition: { field: 'operation', value: 'update_worker' }, required: { field: 'operation', value: 'update_worker' }, wandConfig: { enabled: true, maintainHistory: true, - prompt: `Generate a Workday worker update payload as JSON. + prompt: `Generate a Workday Personal_Information_Data payload as JSON for the Change_Personal_Information SOAP operation. -### COMMON FIELDS -- businessTitle: Job title string -- primaryWorkEmail: Work email address -- primaryWorkPhone: Work phone number -- managerReference: Manager worker ID +### SUPPORTED FIELDS (demographics only) +- Date_Of_Birth: ISO date string (YYYY-MM-DD) +- Gender_Reference: { ID: { attributes: { "wd:type": "Gender_Code" }, $value: "Male" | "Female" | ... } } +- Marital_Status_Reference: { ID: { attributes: { "wd:type": "Marital_Status_ID" }, $value: "Married" | "Single" | ... } } +- Ethnicity_Reference: { ID: { attributes: { "wd:type": "Ethnicity_ID" }, $value: "..." } } +- Citizenship_Status_Reference: same shape + +### NOT SUPPORTED BY THIS OPERATION +- Business title (use Change_Job) +- Work email / phone / manager (different SOAP ops) ### RULES - Output ONLY valid JSON starting with { and ending with } - Include only fields that need updating ### EXAMPLE -User: "Update title to Senior Engineer" -Output: {"businessTitle": "Senior Engineer"}`, +User: "Mark marital status as Married" +Output: {"Marital_Status_Reference":{"ID":{"attributes":{"wd:type":"Marital_Status_ID"},"$value":"Married"}}}`, generationType: 'json-object', }, }, @@ -424,8 +431,16 @@ Output: {"businessTitle": "Senior Engineer"}`, lastDayOfWork: { type: 'string', description: 'Last day of work' }, }, outputs: { - worker: { type: 'json', description: 'Worker profile data' }, - workers: { type: 'json', description: 'Array of worker profiles' }, + worker: { + type: 'json', + description: + 'Worker profile (id, descriptor, primaryWorkEmail, primaryWorkPhone, businessTitle, supervisoryOrganization, hireDate, workerType, isActive)', + }, + workers: { + type: 'json', + description: + 'Array of worker profiles (id, descriptor, primaryWorkEmail, businessTitle, supervisoryOrganization, hireDate, workerType, isActive)', + }, total: { type: 'number', description: 'Total count of results' }, preHireId: { type: 'string', description: 'Created pre-hire ID' }, descriptor: { type: 'string', description: 'Display name of pre-hire' }, @@ -434,10 +449,16 @@ Output: {"businessTitle": "Senior Engineer"}`, hireDate: { type: 'string', description: 'Hire date' }, assignmentId: { type: 'string', description: 'Onboarding assignment ID' }, planId: { type: 'string', description: 'Onboarding plan ID' }, - organizations: { type: 'json', description: 'Array of organizations' }, + organizations: { + type: 'json', + description: 'Array of organizations (id, descriptor, type, subtype, isActive)', + }, eventId: { type: 'string', description: 'Event ID for staffing changes' }, effectiveDate: { type: 'string', description: 'Effective date of change' }, - compensationPlans: { type: 'json', description: 'Compensation plan details' }, + compensationPlans: { + type: 'json', + description: 'Compensation plans (id, planName, amount, currency, frequency)', + }, terminationDate: { type: 'string', description: 'Termination date' }, }, } From 27a9f53afa34526cdf7d467e3d2cbc07c260ecd5 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Wed, 6 May 2026 20:54:41 -0700 Subject: [PATCH 2/2] fix(workday): correct Date_of_Birth casing in update wand prompt --- apps/sim/blocks/blocks/workday.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/sim/blocks/blocks/workday.ts b/apps/sim/blocks/blocks/workday.ts index d8991d4c521..8b27c8a94b9 100644 --- a/apps/sim/blocks/blocks/workday.ts +++ b/apps/sim/blocks/blocks/workday.ts @@ -243,7 +243,7 @@ export const WorkdayBlock: BlockConfig = { prompt: `Generate a Workday Personal_Information_Data payload as JSON for the Change_Personal_Information SOAP operation. ### SUPPORTED FIELDS (demographics only) -- Date_Of_Birth: ISO date string (YYYY-MM-DD) +- Date_of_Birth: ISO date string (YYYY-MM-DD) - Gender_Reference: { ID: { attributes: { "wd:type": "Gender_Code" }, $value: "Male" | "Female" | ... } } - Marital_Status_Reference: { ID: { attributes: { "wd:type": "Marital_Status_ID" }, $value: "Married" | "Single" | ... } } - Ethnicity_Reference: { ID: { attributes: { "wd:type": "Ethnicity_ID" }, $value: "..." } }