Built-in Actions

View as Markdown

Using Built-in Actions

Moveworks provides a wide range of built-in actions to help you built AI agents quickly.

When you want to use a built-in action in your Compound Action, you can use mw.{{action_name}} as your action.action_name. For example, if you want to use the create_generic_approval_request native action, you would use mw.create_generic_approval_request.

Action Reference

create_generic_approval_request

Create a Moveworks in-bot approval request. Plugin will continue if the approval is answered within 30 days before the approval is dropped from the database.

Action Name: mw.create_generic_approval_request

Input Parameters:

  • approval_key (string): The approval key which describes the approval workflow. If omitted, MUST provide the approvers argument. Currently Supported Keys (Optional)
  • approvers (List[User]): List of user objects from whom to get approval. Will reach out to all users, but only one approval will be needed. If provided, this will override the approval key. (Optional)
  • approval_details (string): The details that need approval. (Required)
  • users_requested_for (List[User]): Users who we are requesting approval for. (Required)

🚧 Make sure you pass User objects, not emails.

You can retrieve user objects via an email address using our user built-in actions

Request Schema:

Example
1- action:
2 output_key: create_generic_approval_request_result
3 action_name: mw.create_generic_approval_request
4 progress_updates:
5 on_complete: ON_COMPLETE_MESSAGE
6 on_pending: ON_PENDING_MESSAGE
7 input_args:
8 approval_key: '"MANAGER"'
9 approval_details: '"Need access to coupa"'
10 users_requested_for:
11 - data.users[0]
12 - data.users[1]
Schema
1{
2 "approval_key": "string",
3 "ticket": "Ticket",
4 "approvers": "List[User]",
5 "approval_details": "string",
6 "users_requested_for": "List[User]"
7}

Action Response Schema:

Schema for Approved
{
"state": {
"initial_status": "PROCESSING",
"status": {
"john@moveworks.ai": "APPROVED"
},
"notifiers": {
"action_callback": {
"action_id": "ZagCDJRsdeD"
}
}
},
"status": "APPROVED",
"approved_by": [
{
"full_name": "John",
"record_id": "10769610738892443",
"email_addr": "john@moveworks.ai"
}
]
}
Schema for Denied
{
"state": {
"initial_status": "PROCESSING",
"status": {
"john@moveworks.ai": "APPROVED"
},
"notifiers": {
"action_callback": {
"action_id": "ZagCDJRsdeD"
}
}
},
"status": "DENIED",
"denied_by": [
{
"full_name": "John",
"record_id": "10769610738892443",
"email_addr": "john@moveworks.ai"
}
]
}
Example output reference
data.create_generic_approval_request_response.status == "approved"

generate_structured_value_action

Check LLM Actions for full reference

generate_text_action

Check LLM Actions for full reference

batch_send_plaintext_chat_notification

Sends a chat notification to a user.

Action Name: mw.batch_send_plaintext_chat_notification

Input Parameters:

  • notifications (List[Notification]): The list of users notifications.
    • Notification (Object): The object containing the user record and the message

Request Schema:

Example
1- action:
2 output_key: target_users
3 action_name: mw.batch_get_users_by_email
4 input_args:
5 user_emails: ["some emails in here"]
6- action:
7 action_name: mw.batch_send_plaintext_chat_notification
8 output_key: notification_result
9 input_args:
10 notifications:
11 MAP():
12 items: data.target_users.user_records
13 converter:
14 user_record_id: item.user.record_id
15 message: "This is a test notification"

batch_get_users_by_email

Retrieves multiple users by email against Moveworks’ Internal Identity store.

Action Name: mw.batch_get_users_by_email

Input Parameters:

  • user_emails (List[string]): The email addresses of the users to retrieve.

Request Schema:

Example
1- action:
2 output_key: get_user_by_email_result
3 action_name: mw.get_user_by_email
4 progress_updates:
5 on_complete: ON_COMPLETE_MESSAGE
6 on_pending: ON_PENDING_MESSAGE
7 input_args:
8 user_emails: data.users_to_message_list # This should be an array of email addresses
Schema
1{
2 "user_emails": "List[string]",
3}

Result Schema:

JSON
1{
2 "user_records": [
3 {
4 "lookup_id": "12345",
5 "user": {
6 "full_name": "John Doe",
7 "email_addr": "john.doe@moveworks.ai",
8 ...
9 }
10 },
11 {
12 "lookup_id": "67890",
13 "user": {
14 "full_name": "Jane Smith",
15 "email_addr": "jane.smith@moveworks.ai",
16 ...
17 }
18 }
19 ]
20}

You can find the full list of user fields in our Moveworks Data Object page.

get_user_by_email

Retrieve a user record according to their email address. This action will return all user attributes, along with custom attributes.

Action Name: mw.get_user_by_email

Input Parameters:

  • user_email (string): The email address of the user to retrieve.

Request Schema

Example
1- action:
2 output_key: get_user_by_email_result
3 action_name: mw.get_user_by_email
4 progress_updates:
5 on_complete: ON_COMPLETE_MESSAGE
6 on_pending: ON_PENDING_MESSAGE
7 input_args:
8 user_email: "johndoe@moveworks.ai"
Schema
1{
2 "user_email": "string"
3}

Result Schema

1{
2 "user": {
3 "full_name": "John Doe",
4 "email_addr": "jdoe@moveworks.ai",
5 ...
6 }
7}

You can find the full list of user fields in our Moveworks Data Object page.