Payload Builder step

  • Release version: Australia
  • Updated March 12, 2026
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Payload Builder step

    The Payload Builder step is a Workflow Studio action that enables action designers with theactiondesignerrole to create dynamic JSON or XML payloads by defining name-value pairs. This step allows easy construction of structured data payloads using dynamic data pills, facilitating integration and automation tasks within ServiceNow workflows. Note that for JSON payloads, this step is deprecated and replaced by the JSON Builder step.

    Show full answer Show less

    Key Features

    • Name-Value Pairs: Define keys (names) and values dynamically for JSON or XML payloads. Values can be static or derived from data pills.
    • Dynamic Payload Generation: Use drag-and-drop data pills to create dynamic and context-sensitive payload content.
    • Omit If Empty: Optionally exclude pairs with empty or null values to streamline payloads.
    • Output Format: Choose between JSON or XML formatting for the payload.
    • XML Namespace: When outputting XML, assign a namespace prefix to elements to meet integration requirements.
    • Include Outer Structure: Decide whether to wrap name-value pairs within a top-level container (e.g., curly braces for JSON or a root XML element).
    • Send Empty Structure: Control whether an empty but valid JSON or XML structure is sent when no name-value pairs have data, or produce an empty payload.
    • Parent Node: For XML outputs with an outer structure, specify the root element name (default is xml).
    • Preview: View the read-only generated payload to verify the output before execution.
    • Error Handling: Configure whether the workflow continues or triggers error evaluation if this step fails, supporting robust action error management.

    Practical Application for ServiceNow Customers

    ServiceNow customers can use the Payload Builder step within custom actions to construct flexible, dynamic payloads for integrations or API calls. This step simplifies creating structured JSON or XML data using workflow data, improving automation efficiency. The ability to omit empty values and control the output structure helps tailor payloads to external system requirements. Error handling options ensure predictable workflow behavior in failure scenarios.

    For JSON payload creation, customers should transition to the newer JSON Builder step as this step is deprecated for JSON use.

    Enable action designers to easily create name-value pairs in JSON and XML payloads using dynamic data.

    Roles and availability

    Available as an Workflow Studio action step. Users with the action_designer role can create a custom action with one or more action steps.
    Note:
    For JSON, this step is deprecated and replaced by the JSON Builder step.

    Fields

    Fields Description
    Name Value Pairs

    The name-value pairs to include in the payload. Click the plus icon to add name-value pairs. Drag data pills into either field to produce dynamic payloads.

    The Name becomes a key in JSON and an element in XML. For example, suppose you create this name-value pair.
    • Name: short_description
    • Value: [action]->[short_description]
    When the system formats the name-value pair as JSON:
    "short_description": "[action]->[short_description]"

    When the system formats the name-value pair as XML:

    <short_description>[action]->[short_description]</short_description>
    Omit if empty The option to exclude a name-value pair if the value is empty or null.
    Note:
    This field is only visible after clicking the down arrow to display advanced options.
    Output Format The payload file format.
    • JSON: Select to format the payload as a JSON document.
    • XML: Select to format the payload as an XML document.
    Namespace The XML namespace to apply to each element. For example, when the namespace is set to incident:
    <incident:short_description>[action]->[short_description]</incident:short_description>
    Note:
    This field is only visible when the Output Format is set to XML.
    Include Outer Structure

    The option to include or exclude a top level container appropriate to the output format. When the Output Format is JSON, curly braces contain the name-value pairs. When the Output Format is XML, a specified XML element contains the name-value pairs.

    For example, when the system formats the name-value pair as JSON:

    {
      "short_description": "[action]->[short_description]"
    }

    When the system formats the name-value pair as XML:

    <xml>
      <short_description>[action]->[short_description]</short_description>
    </xml>
    Send Empty Structure

    The option to send valid JSON or XML structures when the payload is empty. Enable this option to include JSON or XML structural text in the payload.

    For example, when the system formats an empty structure as JSON:
    {}

    When the system formats an empty structure as XML:

    <xml></xml>

    Disable this option to produce an empty payload.

    Empty payloads can occur when you select the Omit if empty option for every name-value pair, and all name-value pairs in the payload produce empty values.

    Parent Node The name of the XML element that contains the name-value pairs. The default parent node element is xml.
    Note:
    This field is only visible when the Output Format is set to XML and the option to Include Outer Structure is enabled.
    Preview The read-only payload the step produces.

    Action error evaluation

    If this step fails
    Data type: Choice

    Option to continue running the next step or go to error evaluation. To use the step status code or message for a custom action error condition, see .