Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

ajaymalik
ServiceNow Employee

Objective

To enhance any Agent (E.g: Workday HR payroll management AI agent) below is a step-by-step guide to improve the response logic. The goal is to move from a rigid, technical list of instructions to a more fluid, conversational flow that feels like a natural human interaction.

 

How to Navigate and Update the AI Agent

  1. Open AI Agent Studio: In your ServiceNow instance, use the All menu to search for and select AI Agent Studio.

ajaymalik_11-1777149238496.png

 

  1. Locate Your Agent: Click on the Create and manage tab and select the Workday HR payroll management AI agent from your list.

ajaymalik_12-1777149238501.png

 

  1. Access the Specialty Tab: You will automatically land on the Define the specialty section.

ajaymalik_13-1777149238519.png

 

  1. Edit the Steps: Scroll down to the Define the role and required steps area. Locate the List of steps text box (marked as Version V1).

ajaymalik_14-1777149238536.png

 

  1. Apply Changes: Highlight the existing text, paste the optimized version below, and click Save and continue at the bottom right.

 

"List of Steps" for a User-Friendly Response

Copy and paste the following content into the "List of steps" instruction field:

(Note: The below steps are sample steps and can be updated based on user requirement)

 

  1. Intake & Clarification: Greet the user professionally. Confirm they are seeking payslip information. If the request is vague (e.g., "Show me my money"), ask a clarifying question like: "I can help with that. Are you looking for a specific payslip or a summary for a certain period?"
  2. Identity & Context Validation: 
  • Worker ID: Check if the Worker ID is available. If not, politely request it: "To access your records securely, could you please provide your Worker ID?"
  • Date Parameters: Ensure you have the Start Date, End Date, and Period Date Indicator. If missing, explain: "I need a date range to pull the correct payroll data for you."
  1. Intelligent Execution: Once all mandatory inputs (Worker ID, Dates, Report Name/Owner) are validated, execute the Look up Payslip action exactly once.
  2. Error & Edge Case Handling: If the action fails, translate technical errors into helpful HR language (e.g., "I'm having trouble connecting to Workday right now; please try again in a few minutes"). If no data is returned, suggest the user check their date range.
  3. Human-Friendly Response Transformation (Priority):
  • Summary First: Start with a brief natural language summary (e.g., "I've retrieved your payslip for [Date Range]. Your Net Pay was [Amount].")
  • Categorized Tables: Organize output into logical Markdown tables: Earnings, Deductions, Taxes, and Employer Benefits.
  • Dynamic Labeling: Use the column names from the data but ensure they are human-readable (e.g., convert GROSS_PAY_AMT to Gross Pay).
  • Cleanliness: Omit any sections that contain no data. Never display system IDs, metadata, or raw JSON strings.
  1. Response Depth Control: By default, provide the formatted summary and tables. Only provide granular, line-by-line technical details if the user explicitly asks for "detailed raw data."

 

ajaymalik_15-1777149238561.png

 

Sample Response

 

ajaymalik_16-1777149238571.png

 

 

Agent Tool Update

Based on the Look up Payslip configuration, users can control how the AI agent processes and presents data by modifying the Output Transformation Strategy.

 

By default the tool is set to "None", which means the agent will pass the data through without additional AI-driven formatting. To change how the response is handled, the below steps can be performed:

 

Modifying Agent Tool Response Behavior

To refine how the Workday HR payroll management AI agent communicates its findings, you must adjust the transformation settings within the Agent Tool record.

 

  1. Select the Transformation Strategy

The Output transformation strategy field dictates the linguistic style and depth of the final response. You can choose from the following options:

Strategy

Description

Best Use Case

None

Returns the output exactly as generated by the tool or post-processing script.

Technical debugging or raw data transfers.

Concise

Provides a brief, "just the facts" summary.

Quick mobile notifications or status updates.

Verbose

Provides a detailed, comprehensive explanation of the results.

Complex payroll queries where context is key.

Paraphrase

Rewrites the output in a more natural, conversational tone.

Enhancing the "human feel" of the AI interaction.

Summary for Search

Distills the data into a format optimized for search result snippets.

High-level overviews in a knowledge base context.

  1. Implementation Steps
    • Navigate to the Agent Tool record for Look up Payslip.
    • Locate the Output transformation strategy dropdown menu on the right side of the form.
    • Select your desired strategy (e.g., Concise for efficiency or Paraphrase for better UX).
    • Click Update in the top right corner to save the changes.

 

ajaymalik_17-1777149238579.png

 

 

  1. Advanced Customization (Optional)

If the standard strategies do not meet your requirements, you can use the Post processing script area (ES12 mode supported) to programmatically filter or format the JSON output before the AI applies the transformation strategy.

 

Version history
Last update:
Saturday
Updated by:
Contributors