Compound Action Patterns
This document’s purpose is to accelerate your development process by providing a collection of reusable patterns for common tasks.
Instead of showcasing entire** end-to-end** use cases, this guide focuses on individual, common “steps” you’ll encounter while building. For each pattern, we recommend the most efficient method, whether it’s an LLM action, a Moveworks Data Mapper expression, a DSL query, or a Python Script.
Let’s dive into the patterns.
Performing Actions in Batch
Problem: You want to perform a series of actions repetitively for a list elements. For example, sending a notification to a group of users.
List of users
Usage Compound Action
Deduplicating a List
Problem: You have a list that contains duplicate values, and you need a list with only unique elements.
Deduplicating a list of scalars
Input
Usage in Compound Action
Result
Deduplicating a list of objects
In this case we will deduplicating a list of objects that have the same email key
Usage in Compound Action
Sort Alphabetically
Problem: You need to provide a list of elements sorted alphabetically
Input Arguments
Compound Action
Result
Sort Timestamps
Problem: You want to sort a list of based on the timestamp
Sorting a list of timestamps
input
Compound Action
Result
Sorting a list of objects by timestamp
Input
Compound Action
Result
Easiest way to multiline string usage in YAML
Problem: You want to a multiline string’s structure to be maintained
Solution: Use Render() and the | character with your template value indented