For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Logo
DeveloperAcademyCommunityStatus
ReferenceGuides
ReferenceGuides
  • Agent Studio
    • Overview
    • Quickstart Guides
    • Core Concepts
    • Conversation Process
    • Actions
    • Connectors
    • System Triggers
    • Agent Architect
      • DSL And Mapper Playground
      • Common DSL & Mapper Patterns
      • DSL
        • Full Mapper Reference
        • Mapping 2d Arrays To Lists Of Json
        • Examples Parsing A Streamed Response
        • Examples Sending An XML Request
    • Cookbooks
    • Development and Testing
    • AI Agent Marketplace
    • Developer Tools
  • Agentic AI
    • LLM Fundamentals
    • The Agentic Reasoning Engine
    • Memory Constructs
    • Conversational Context
    • Guardrails
    • Grounding and Hallucinations
    • Continuous Learning
    • LLMs & SLMs
    • Steerability Tools
    • Multilingual Support
  • Core Platform
    • User Identity
    • Moveworks Agent (On-Prem)
    • Approvals Engine
    • Entity Catalog
    • Moveworks Data Objects
    • Security Information and Event Management (SIEM) Logs Overview
DeveloperAcademyCommunityStatus
On this page
  • Option 1: Build an XML string with DSL
  • Option 2: Build an XML string with Python Scripts
Agent StudioConfiguration LanguagesMapper

Examples: Sending an XML Request

||View as Markdown|
Was this page helpful?
Edit this page
Previous

Cookbooks

Next
Built with

Scenario: An API returns data in XML format, which Moveworks automatically parses into JSON. You need to modify one of the objects in that API by constructing and sending an XML request payload.

You receive a JSON payload like:

json
1{
2 "data": {
3 "side_dishes": [
4 { "display_name": "corn", "value": "corn" },
5 { "display_name": "fries", "value": "fries" }
6 ]
7 }
8}

You want to generate this XML to send as a payload to a subsequent call

1<sides><side>corn</side><side>fries</side></sides>

Option 1: Build an XML string with DSL

Using DSL you can construct your payload as needed into a single string to send as an XML body.

xml_body: >
$CONCAT([
"<sides>",
data.side_dishes
.$MAP((val) => $CONCAT(["<side>", $TEXT(val.value), "</side>"]))
.$CONCAT(""),
"</sides>"
])


Option 2: Build an XML string with Python Scripts

Create a Script Action (standalone or inside a Compound Action) and configure:

  • output_key: where the script result will be stored
  • input_args:side_dishes: data.side_dishes
  • code: the python code that returns the XML string

Python code: JSON → XML (stdlib-only)

Paste the following into the Script Action code field.

1from xml.etree import ElementTree as ET
2
3
4def build_sides_xml(side_dishes):
5 root = ET.Element("sides")
6
7 for dish in side_dishes or []:
8 side = ET.SubElement(root, "side")
9 side.text = str(dish.get("value", ""))
10
11 return ET.tostring(root, encoding="unicode")
12
13
14# -------------------------
15# Main logic (returned value)
16# -------------------------
17
18xml_output = build_sides_xml(side_dishes)
19xml_output