Compound Actions
Compound Actions empower developers to build sophisticated, multi-step automations within Agent Studio, chaining actions, data transformations, and logic into reusable AI workflows.
Think of Compound Actions as an orchestration layer that can:
- Collect input arguments from data sources
- Execute actions to complete tasks
- Conditionally run different branches of logic
- Loop over items and run steps for each item
- Run steps at the same time
- Return information to the user or processes
- Handle error gracefully
- Notify users with interactive messages and buttons
Why Use Compound Actions
- Modularity: Break down monolithic agents into testable, composable steps.
- Efficiency: Parallelize tasks or loop over lists to cut execution time.
- Resilience: Built-in error handling and early exits keep workflows robust.
- Interactivity: Notify users mid-flow with buttons for seamless handoffs.
flowchart TD A[Start: User Query or Trigger] --> B[Inputs<br/>e.g., Data Mapping from User/Context] B --> C[Core Actions<br/>e.g., HTTP Calls, Scripts] C --> D{Control Flow?} D -->|Switch: Condition Check| E[Branch 1<br/>e.g., Admin Path] D -->|Switch: Condition Check| F[Branch 2<br/>e.g., User Path] E --> G[Actions/Next Steps] F --> G G --> H[Parallel: Split Independent Tasks] H --> I[Task 1<br/>e.g., Fetch Data] H --> J[Task 2<br/>e.g., Notify User] I --> K[Merge Outputs] J --> K K --> L[Outputs<br/>e.g., Return Mapped Data] L --> M[End: Chat Response or Handoff] style A fill:#e1f5fe style M fill:#e8f5e8 style D shape: diamond style H shape: diamond
The steps
Key
steps
KeyThe steps
key defines a sequence of expressions executed in order, forming the backbone of multi-step Compound Actions. It groups logic cleanly, ensuring predictable flow while enabling nesting for controls like switch
or parallel
. Use it whenever chaining more than one expression, it's required for compound structures to maintain order and scope.
steps:
- action:
action_name: fetch_user_data
output_key: user_info
input_args:
user_id: data.requestor_id
- switch: # Nested control
cases:
- condition: user_info.role == "admin"
steps:
- return:
output_mapper:
access: '''granted'''
Getting Started
-
Prerequisites: Familiarity with Moveworks Data Mappers and DSL
-
Use the Low Code Editor: Get started fast with the low code editor. Switching back to code mode will generate the compound action script for you and viceversa.
CommentsYAML comments (
#
) are supported and preserved during edits, but switching between low-code and code views will strip them.
Updated 1 day ago