Creates and schedules home healthcare visits, such as start-of-care or recurring visits, based on specified work types, skills, time slots, and a patient’s address.
This action is available in API version 64.0 and later. Home Health agentic scheduling must be enabled.
The action has three inputs. Pass the address, work types, and recurrence series inside recurringVisitSchedulingInput.
Input
Type
Description
clinicalServiceRequestId
String
Required. The ID of the clinical service request associated with the visits. The record must exist and must have a patient. Every workTypeId in visitWorkTypes must be linked to this request through a clinical service request detail. If the record can’t be found, the action returns INVALID_INPUT and this message: We couldn’t find a Clinical Service Request record associated with the ID “{0}” specified for the {1} parameter. Check the record and try again.
careResourceCount
Integer
Required. The number of care resources required for each home visit. Set a value from 1 to 5. The value must equal the number of entries in visitWorkTypes.
recurringVisitSchedulingInput
healthcloudext__RecurringVisitSchedulingInput
Required. The visit details used to schedule the visits, including the service territory, address, work types, and recurrence series. For the fields in this record, see Recurring Visit Scheduling Input Fields.
Recurring Visit Scheduling Input Fields
These fields are on healthcloudext__RecurringVisitSchedulingInput. A series can override the service territory, scheduling policy, address, and work type details.
Field
Type
Description
serviceTerritoryId
String
Required. The ID of the service territory that contains the care resources to assign. A series can override this value with its own serviceTerritoryId.
schedulingPolicyId
String
Optional. The ID of the home health scheduling policy used to schedule the visits. A series can override this value.
isAutoAssignCareResource
Boolean
Optional. Indicates whether to automatically assign care resources to the scheduled visits. The default value is true.
timeZoneId
String
Optional. The IANA time zone ID used to interpret visit times, such as America/Los_Angeles. If you omit this value, the action uses the running user’s time zone. The value must be a valid IANA time zone ID. Use the same time zone for this field, the service territory, and the operating hours.
visitAddress
VisitAddress
Conditional. The address where the visits take place. Required unless every series specifies its own visitAddress. For the address fields, see Visit Address Fields.
visitWorkTypes
VisitWorkType[]
Required. The work types to schedule for each visit. Specify 1 to 5 entries. The number of entries must equal careResourceCount, and each workTypeId can appear only once. Each work type must be linked to the clinical service request. If a visit plan for the same work type and clinical service request is already in progress, the action returns INVALID_INPUT. When you schedule visits again for a clinical service request that was scheduled before, include the work type that was primary the first time. For the work type fields, see Visit Work Type Fields.
visitRecurrenceDetails
VisitRecurrenceDetails[]
Required. The recurrence series to schedule. Specify 1 to 10 series. Each series is validated and scheduled with the same clinical service request. Use one series when the days and times stay the same. Use more than one series when the days, times, address, or operating hours change from one set of visits to the next. For the series fields, see Visit Recurrence Details Fields.
Visit Address Fields
Use these fields for the top-level visitAddress or for a series visitAddress that overrides it.
Field
Type
Description
street
String
Optional. The street address of the visit location.
city
String
Optional. The city of the visit location.
state
String
Optional. The state or province of the visit location.
postalCode
String
Optional. The postal code of the visit location.
country
String
Optional. The country of the visit location.
Visit Work Type Fields
Use these fields in the top-level visitWorkTypes list. A series can supply its own visitWorkTypes list to override these fields for work types that are already in the top-level list. A series can’t add a work type. A field set on the series replaces the top-level value. A field left out is inherited. If a series supplies this list, the list size must equal careResourceCount.
Field
Type
Description
workTypeId
String
Required. The ID of the work type to schedule. It must be linked to the clinical service request and can appear only once in the list. In a series, the ID must already be in the top-level visitWorkTypes list. A duplicate ID returns INVALID_INPUT.
skillIds
String[]
Optional. The skills required for the visit.
workPlanTemplateIds
String[]
Optional. The IDs of the work plan templates to apply to the visit. Specify up to 13 IDs.
additionalVisitInstructions
String[]
Optional. Additional instructions for the visit, added as work steps. Specify up to 20 entries.
preferredResources
String[]
Optional. The service resource IDs to prefer for the visit. Each ID must be a valid service resource ID. The action creates a resource preference of type Preferred.
requiredResources
String[]
Optional. The service resource IDs that must be assigned to the visit. Each ID must be a valid service resource ID. The action creates a resource preference of type Required.
excludedResources
String[]
Optional. The service resource IDs that must not be assigned to the visit. Each ID must be a valid service resource ID. The action creates a resource preference of type Excluded.
duration
Integer
Optional. The duration of each visit, in minutes. If you set this value, use a positive integer.
Visit Recurrence Details Fields
Each entry is one series. Set either visitTimeSlots or operating hours for that series.
Field
Type
Description
startDate
Date
Required. The date on which the series starts.
rrule
String
Required. The recurrence rule for the series. Include INTERVAL. A monthly rule supports one BYMONTHDAY only. To visit on two days of the month, use two series. The rule must produce at least one visit date on or after startDate. Supported parts are FREQ, INTERVAL, BYMONTHDAY, BYSETPOS, BYDAY, BYMONTH, UNTIL, and COUNT. Daily: RRULE:FREQ=DAILY;INTERVAL=1;COUNT=5. Weekly: RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,FR;COUNT=12. Biweekly or alternate weeks: RRULE:FREQ=WEEKLY;INTERVAL=2;BYDAY=TU,TH;COUNT=8. Monthly: RRULE:FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=1;COUNT=6.
visitTimeSlots
VisitTimeSlot[]
Conditional. The time slots for each visit date in this series. Specify up to 5 slots. Required unless isTimeSlotFromOperatingHours is true. slotStartTime must be earlier than slotEndTime. For the slot fields, see Visit Time Slot Fields.
isTimeSlotFromOperatingHours
Boolean
Conditional. Indicates whether to take the time slots from the operating hours record instead of visitTimeSlots. If true, operatingHoursId is required and any visitTimeSlots on this series are ignored. Set this value on each series. One series can use operating hours while another series in the same request uses explicit time slots.
operatingHoursId
String
Conditional. The ID of the operating hours record whose time slots are used for each visit date. Required when isTimeSlotFromOperatingHours is true. The action expands rrule and requires at least one time slot on every weekday the rule falls on. If the ID can’t be resolved, or a weekday has no time slot, the action returns INVALID_INPUT. When the operating hours record has more than one time slot on a day, each slot becomes its own visit on that date. Slot times are applied in timeZoneId.
visitSourceId
String
Optional. The ID of the reference record used as the source for this series, such as a referral or a quote.
visitWorkTypes
VisitWorkType[]
Optional. Overrides fields of work types already listed in the top-level visitWorkTypes, for this series only. This list can’t add work types. Fields you leave out are inherited. If you supply this list, its size must equal careResourceCount. For the fields you can override, see Visit Work Type Fields.
visitAddress
VisitAddress
Optional. Overrides the top-level address for this series. For the address fields, see Visit Address Fields.
serviceTerritoryId
String
Optional. Overrides the top-level service territory for this series.
schedulingPolicyId
String
Optional. Overrides the top-level scheduling policy for this series.
recurrenceOrder
Integer
Optional. The position of this series in the request.
nextStartDate
Date
Optional. The date from which the next batch of visits is created when visits are created in rolling windows.
Visit Time Slot Fields
Use these fields when a series sets its own visit windows instead of operating hours.
Field
Type
Description
slotOrder
Integer
Optional. The position of the time slot within the series.
slotStartTime
String
Required. The start time of the slot, such as 09:00. This time must be earlier than slotEndTime.
slotEndTime
String
Required. The end time of the slot, such as 11:00.
Outputs
Output
Type
Description
careServiceVisitPlanIds
String
The IDs of the care service visit plan records created for the scheduled visits.
isSuccess
Boolean
Indicates whether the visits were scheduled successfully.
errorMessage
String
The error message returned when the visits can’t be scheduled. For an unexpected save or runtime failure, the action returns UNKNOWN_EXCEPTION and this message: Something went wrong while scheduling the recurring visits. Try again or ask your Salesforce admin for help. Record IDs and platform error text stay in the server log.
Example
Single series
Use one series when a patient has the same visit pattern each week. This request schedules skilled nursing every Monday, Wednesday, and Friday for 12 visits. Visit times come from the operating hours record, so each weekday uses the slots already set for that day. To schedule daily, biweekly, or monthly visits, keep this request and change rrule.
Use two series when the days or times change from one week to the next and one recurrence rule can’t describe both patterns. This request schedules visits for clinical service request CSR-001 (0jyxx0000004C92EAE) with one care resource per visit. Each visit uses work type Worktype-001 (08qxx0000004C92EAE), the RN skill, work plan template WorkPlan-001 (0PNxx0000000001AAA), the instruction “Check vitals”, and a 60-minute duration. The visit address is 123 Main St, San Francisco, CA 94105, US. The request uses service territory ST-001 (0Hhxx0000004D01CAE) and scheduling policy SP-001 (a0cxx0000000001AAA) in the America/Los_Angeles time zone, and care resources are assigned automatically.
Both series repeat every other week, end on December 31, 2026, and use source record REF-001 (a05xx0000000001AAA).
Series A starts Monday, November 9, 2026, and repeats on Monday, Wednesday, and Friday. Visit times come from operating hours OH-001 (0OHxx0000004C92EAE). Series B starts Monday, November 16, 2026, and repeats on Tuesday and Thursday from 2:00 PM to 4:00 PM. Series B sets isTimeSlotFromOperatingHours to false and overrides the visit duration to 45 minutes. The other work type fields are inherited from the top-level list.