XML parser step

  • Release version: Zurich
  • Updated July 31, 2025
  • 3 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 XML parser step

    The XML parser step in ServiceNow's Workflow Studio enables you to extract and map structured data from an XML payload to a complex object output without scripting. This allows you to use the parsed data in subsequent steps or actions within your workflows. The step requires an active Integration Hub subscription and is designed to simplify XML data handling by automatically populating complex objects at runtime based on the XML input.

    Show full answer Show less

    Key Features

    • Integration Hub Requirement: The step is available after activating the necessary plugin and is accessible under Integrations.
    • User Roles: Users with the actiondesigner role can create custom actions incorporating this step.
    • Payload Size Limits: At runtime, supports XML payloads up to 10 MB; for larger payloads, Data Stream actions are recommended. At design time, sample payloads up to 64,000 characters are supported.
    • Source Data Configuration: Select or drag a data pill containing XML data (e.g., REST step response) as the Source. Example payloads help generate the complex object output structure.
    • Supported XML Constraints: No XML namespaces in complex objects, no multiple namespaces, no multidimensional arrays, and restrictions on special characters and attribute values (e.g., no double colons "::"). Payloads larger than 2 MB cannot be saved as examples.
    • Payload Views: Choose between Raw (editable XML) and Structured (tree view) to view and interact with the example payload; XPath for elements can be copied from the tree view for accurate mapping.
    • Target Structure Generation: Automatically generate the output structure from the example payload or manually create and edit the complex object output. Child elements default to strings but can be customized.
    • Element Configuration: Define labels, internal names (with naming restrictions), data types (String, Object, Array.String, Array.Object), mandatory flags for strings, and add nested child elements.
    • Advanced Options: Save object structures as templates for reuse, and add max length, hints, and default values for string elements.
    • XPath Mapping: Modify or input XPath expressions to control how XML elements map to complex object fields; conditional XPath expressions are not supported.

    Practical Application for ServiceNow Customers

    This step empowers customers to efficiently parse XML responses from integrations, such as REST APIs, into structured data that can be used throughout workflows without custom scripting. The automatic generation of complex object outputs speeds up integration development while providing flexibility to customize data mappings. Payload size limits and XML restrictions guide users to design compatible and performant workflows. Leveraging the XML parser step helps maintain clean, maintainable integration logic and accelerates automation processes involving XML data.

    Identify structured data from an XML payload without having to write script. Map incoming XML elements to a complex object output that you can use in other steps or actions. At runtime, values from an XML payload populate the complex object output.

    To learn more about complex objects, see Complex data.

    Note:
    This step requires an Integration Hub subscription. For more information, see Legal schedules - Integration Hub overview. After the required plugin is activated, the step is visible under Integrations.

    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.

    Payload size limit

    At runtime, XML parser step supports payloads up to 10 MB. For larger payloads, create a Data Stream action. For more information, see Data Stream actions and pagination.

    At design time, XML parser step supports sample payloads up to 64,000 characters.

    Fields

    Field Description
    Source In the Source data field, select or drag a data pill that contains the source XML data. For example, a REST step Response Body data pill. At runtime, values from the data source populate the complex object output.

    Under Source data and in the scripting window, enter an example payload to generate a complex object. For example, if parsing the response from a REST API step that returns a list of users, enter the expected XML for a single user. This field accepts XML with the following limitations:

    • XML namespaces are not applied to the complex object. More than one namespace in an XML file is not supported and generates an error message.
    • Multidimensional arrays are not supported.
    • Some special characters are not supported, such as hyphen and period. Double colons (::) are not supported in attribute values.
    • Payloads larger than 2 MB cannot be saved and generate an error message. However, if working with a large example, you can generate the complex object and delete the example payload before saving the step.
    Structured Payload View Select a view for the example payload.
    • Raw (edit mode): Displays editable XML.
    • Structured: Displays XML in a tree view. Click an element in the tree to copy the element XPath. If creating complex data in the Target field manually, you can paste the XPath into the target XPath field.
    Generate Target Select Generate Target to create the step's output structure from your example payload. Your output data structure appears in the Target field. Child elements for each object are automatically generated as type String. Alternatively, you can manually create your target complex object by adding elements in the Target field.
    Target

    View or edit the XML payload's output structure. Create a structured output by clicking Generate Target, or manually add elements.

    Each element contains the following information in the Edit Object view:

    • Label: Data pill label. By default, the system uses the XML element's name.
    • Name: Internal name for the output element.
      Note:
      Exclamation marks, double colons, the @ symbol, or numbers only aren't valid values for an element's name.
    • Type: Data type, which must be String, Object, Array.String, or Array.Object. The top-level element must be an Object.
    • Mandatory: Toggle to make the element required. This only applies to elements of type String.
    • Add child item: Select the add child item icon (Add child item icon) to add a nested child element.

    Elements of type Object contain the Save as Template advanced option, which allows you to save your object's structure as a complex object template. You can then use this template to define the schema of an Object output for your action.

    For elements of type String, you can also add a max length, hint, and default value as advanced options.

    In the Target header, select Exit Edit Mode when you're done making changes to your output's structure. You can then select the toggle advanced inputs icon (Toggle advanced inputs icon) to view the XPath option.

    The XPath is the path to the element. Modify the XPath to change how source data elements map to complex data variables. If manually adding complex data variables, you can copy the XPath from the Payload view field and paste it in a complex data variable XPath field to ensure the correct hierarchy. Conditional XPath expressions are not supported.