Recommended
Fixing time zone mismatches in Agentforce agents with proper input types (opens in a new tab)
You will learn how to prevent time zone conversion errors in Agentforce by enabling user profile context, adding explicit LLM instructions, and typing action inputs as ISO 8601 strings.
Why read this
The guide also shows how to structure these elements in an Agent Script that calls a Flow.
The article addresses a common failure mode where Agentforce agents misinterpret local time because Salesforce stores DateTime values in UTC while users communicate in their local time zones. It outlines three required components to fix this: exposing the user profile context, providing explicit reasoning instructions to the large language model, and defining action inputs with the correct data type.
A complete Agent Script example demonstrates an Employee Agent that manages calendar events. The script enables the user profile context to retrieve the current user time zone without asking the user. Reasoning instructions direct the model to apply that time zone for display purposes while omitting offset details from the conversation. Conditional logic gates event actions behind a valid record identifier.
The workflow passes deterministic parameters like account identifiers directly to the Flow, leaving only the start datetime field open for natural language processing. By assigning the lightning__dateTimeStringType complex data type to that input, the agent converts conversational phrases into structured ISO 8601 values before handing them off to the downstream Flow.
Read the original at InfallibleTechie (opens in a new tab)