Skip to navigation
Plugin Building MasterclassEnd-to-End Course

Map Data and Context

Understand each execution scope, move data across boundaries, and choose Mustache, Data Mapper, DSL, or Python.
View as Markdown

Agent Studio does not expose one global bag of data. Every action, compound action, resolver, conversation process, and system trigger has a scoped runtime data bank.

Mappings create explicit bridges between those scopes.

Explore the Data Boundaries

Data available by execution scope

Select a scope to see its inputs, boundaries, and mapping responsibilities.

Conversation process
Available in this scope
  • Collected slots
  • Activity outputs
  • Conversation runtime metadata
Not available automatically
  • Values before their step executes
  • Unreturned compound internals
  • Data from another run
Reasoning engine visibility
Outputs exposed by activities plus the conversation context managed by the reasoning engine.
Mapping responsibility
Keep consecutive backend calls in one compound action unless the assistant must collect a new required slot between them. Put decisions or display around that compound-action boundary.
Source scopeInput or output mapperTarget scope

The Data Bank by Surface

SurfaceCommonly available valuesBoundary
HTTP actionTyped input arguments, meta_info.user in user context, meta_info.action_instance_idAction response
Compound actiondata.<input_arg>, earlier step outputs, user metadata only when the caller provides user contextreturn.output_mapper
Conversation processdata.<slot>, completed activity outputs, meta_info.userActivity output mapping and process result
Conversation action output mapperCurrent action payload as responseReplaces the exposed activity output
Slot validationCandidate value as value, supported user metadataValid or invalid policy result
Dynamic resolverDeclared inputs and explicitly mapped contextExact value or candidate list
Webhook or scheduleTrigger payload/body and mapped backend outputsAction or compound return
User Context Is Trigger-Dependent

meta_info.user exists when execution has conversational user context. A webhook or schedule does not automatically have a user profile. Resolve identity explicitly and map it forward.

Understand the Mapping Layers

Input Mapping

Input mapping supplies an action activity’s typed input arguments from the parent conversation process:

feature_request_id: data.selected_feature_request.id
new_status: data.target_status.value

It answers: What does this action receive?

Output Mapping

Output mapping reshapes the current action payload, referenced as response:

feature_request:
id: response.id
name: response.name
status: response.currentStatus
display_instructions_for_model: >-
Confirm the feature request name and its new status.

Unmapped response fields do not remain in the exposed activity output.

It answers: What does the conversation and reasoning engine receive?

Compound Action Input Arguments

A compound action declares typed entry points. Each internal action block uses input_args to receive exact values from the compound data bank.

It answers: What crosses into this backend workflow and each internal step?

Compound Action Return

The final return.output_mapper creates the compound action’s public result:

- return:
output_mapper:
feature_request:
id: data.updated_request.id
name: data.updated_request.name
status: data.updated_request.currentStatus

Intermediate action outputs stay internal unless you return them.

It answers: What crosses back to the caller?

Choose the Right Language

NeedUseWhy
Insert one scalar into a fixed stringMustacheSmallest substitution tool
Preserve arrays, objects, numbers, or booleansMoveworks Data MapperStructured transformation
Rename, filter, merge, map, or conditionally include fieldsMoveworks Data MapperCreates a new structured payload
Evaluate a rule or validationDSLDeterministic boolean or computed expression
Apply a DSL function inside a mappingData Mapper with embedded DSLCombines structure and computation
Implement complex reusable logic unsuitable for mappingScript actionExplicit Python execution
Interpret or extract unstructured language, images, or documentsLLM actionModel-based content processing
Data Mapper, JSON Bender, and DSL

Moveworks Data Mapper is the current teaching term for structured transformations. Existing references may call the underlying mapping system JSON Bender. DSL is a separate expression language that can run inside mapper fields.

Replace Outputs Intentionally

An output mapper rewrites the exposed output. It is not an annotation layered over the original response.

If you map:

accounts:
MAP():
items: response.data
converter:
id: item.id
name: item.name

Then downstream steps receive accounts, not the original payload plus accounts.

Use this behavior to:

  • Remove metadata, debug fields, and unused nested objects.
  • Rename keys to describe business meaning.
  • Normalize inconsistent provider schemas.
  • Limit arrays before they enter conversational context.
  • Add display_instructions_for_model when presentation needs light steering.

Shape Context for the Reasoning Engine

The reasoning engine sees each output exposed by a conversation action activity. It does not need every API response or internal backend step.

Prefer:

{
"request_id": "FR-1042",
"request_name": "Bulk edit requests",
"new_status": "Planned"
}

Avoid:

{
"lookup_response": {},
"validation_response": {},
"patch_response": {},
"audit_response": {},
"raw_headers": {}
}

When several calls run without user interaction, use a compound action and return one concise object.

Use Display Instructions as Steering

display_instructions_for_model can guide how the assistant presents a result:

display_instructions_for_model: >-
State the feature request name, current status, and product area.
Do not mention internal record identifiers unless the user asks.

Treat this field as presentation guidance, not a deterministic business rule. Use DSL, policies, mappings, or code when a rule must always hold.

Build Along: Map the PurpleSuite Contracts

Create the explicit bridges for the feature-request build:

PurpleSuite end-to-end call trace

Follow one live feature request through the same three API calls and Agent Studio contracts in every chapter.

Shared connector
https://marketplace.moveworks.com
Every API action
Connector adds Bearer PAT. Action adds X-Instance-ID.
Bridge the conversation and backend contracts
The input mapper sends only typed arguments into the workflow. The output mapper exposes only the verified result.
Select one recordRuntime dataObject slot
selected_feature_request:
  id: <data[n].id>
  display_name: <data[n].name>
  current_status: <data[n].currentStatus>
  product_area: <data[n].productArea>
Receives
One candidate from the list response
Returns
A typed selected_feature_request object
How it fits
The user can refer to the record naturally while later modules use the exact PurpleSuite ID.
Successful run: actual API call ledger
1GET/api/purple-suite/community/feature_requestsDynamic resolver retrieves live candidates
2PATCH/api/purple-suite/community/feature_requests/{id}Compound action updates the selected record
3GET/api/purple-suite/community/feature_requests/{id}Compound action verifies the stored result
Use a record returned by your own PurpleSuite instance. Save its original status before the write and restore it after mutation testing when appropriate.
  1. Map the list action’s response array into resolver candidates with id, display_name, and current_status.
  2. Map the selected object’s stable ID and the static resolver’s raw status into the compound action.
  3. Return only the updated request’s name and status to the conversation.

Use this conversation-to-compound input mapping:

feature_request_id: data.selected_feature_request.id
new_status: data.target_status.value

Use this conversation activity output mapping:

updated_feature_request:
name: response.feature_request.name
status: response.feature_request.status
display_instructions_for_model: >-
Confirm the feature request name and its new status.

Inspect the Data Bank at each boundary. Your checkpoint is that the raw list response and internal PATCH and verification responses do not enter conversational context.

Deep Dives

Next, collect slots and resolve values.