Built-in Actions

View as Markdown

Using Built-in Actions

Moveworks provides built-in actions for common platform operations — user lookups, notifications, approvals, and LLM generation. These are ready to use without creating connectors or HTTP actions.

When you want to use a built-in action in your Compound Action, use mw.{{action_name}} as your action_name. For example:

1- action:
2 action_name: mw.get_user_by_email
3 output_key: user_result
4 input_args:
5 user_email: meta_info.user.email_addr

Action Reference

get_user_by_email

Retrieve a single user record by email address. Returns all user attributes including custom attributes.

Action Name: mw.get_user_by_email

Input Parameters:

ParameterTypeRequiredDescription
user_emailstringYesThe email address of the user to retrieve

Example:

1- action:
2 output_key: user_result
3 action_name: mw.get_user_by_email
4 input_args:
5 user_email: meta_info.user.email_addr

Response Schema:

1{
2 "user": {
3 "full_name": "John Doe",
4 "email_addr": "john.doe@moveworks.ai",
5 "record_id": "10769610738892443",
6 "department": "Engineering",
7 ...
8 }
9}

Reference: data.user_result.user.email_addr, data.user_result.user.full_name, etc.

You can find the full list of user fields in our User Attribute Reference.


batch_get_users_by_email

Retrieve multiple users by email in a single call. Use this when you need to resolve several users (e.g., an approver and a requester).

Action Name: mw.batch_get_users_by_email

Input Parameters:

ParameterTypeRequiredDescription
user_emailsList[string]YesThe email addresses of the users to retrieve

Results are returned in the same order as the input email list. If you pass ["manager@example.com", "employee@example.com"], then user_records[0] is the manager and user_records[1] (or user_records[-1]) is the employee.

Example:

1- action:
2 output_key: target_users
3 action_name: mw.batch_get_users_by_email
4 input_args:
5 user_emails:
6 - data.manager_email
7 - data.employee_email

Response Schema:

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

Reference: data.target_users.user_records[0].user for the first user, data.target_users.user_records[-1].user for the last.

You can find the full list of user fields in our User Attribute Reference.


create_generic_approval_request

Create a Moveworks in-bot approval request. The compound action pauses execution until the approval is answered (up to 30 days).

Action Name: mw.create_generic_approval_request

Input Parameters:

ParameterTypeRequiredDescription
approval_detailsstringYesThe details that need approval
users_requested_forList[User]YesUsers who the approval is being requested for
approversList[User]NoUsers from whom to get approval. Reaches out to all; only one approval needed. Overrides approval_key if provided.
approval_keystringNoThe approval key describing the workflow. If omitted, must provide approvers. Supported Keys
titlestringNoTitle of the approval request
Pass User objects, not emails.

approvers and users_requested_for require User objects, not email strings. Retrieve user objects first using mw.get_user_by_email or mw.batch_get_users_by_email.

Example:

1- action:
2 output_key: approval_result
3 action_name: mw.create_generic_approval_request
4 input_args:
5 title: '''Access to Coupa Request'''
6 approval_details: '''Need access to Coupa for procurement workflow'''
7 approvers:
8 - data.manager_user.user
9 users_requested_for:
10 - data.requesting_user.user
11 progress_updates:
12 on_pending: Sending approval request...
13 on_complete: Approval received.

Response Schema (Approved):

1{
2 "status": "APPROVED",
3 "approved_by": [
4 {
5 "full_name": "John Doe",
6 "record_id": "10769610738892443",
7 "email_addr": "john@moveworks.ai",
8 "comment": "Looks good, approved."
9 }
10 ],
11 "state": {
12 "initial_status": "PROCESSING",
13 "status": {
14 "john@moveworks.ai": "APPROVED"
15 }
16 }
17}

Response Schema (Denied):

1{
2 "status": "DENIED",
3 "denied_by": [
4 {
5 "full_name": "John Doe",
6 "record_id": "10769610738892443",
7 "email_addr": "john@moveworks.ai",
8 "comment": "Budget not available for Q2."
9 }
10 ],
11 "state": {
12 "initial_status": "PROCESSING",
13 "status": {
14 "john@moveworks.ai": "DENIED"
15 }
16 }
17}

Reference: data.approval_result.status returns "APPROVED" or "DENIED" (uppercase).

To access the approver/denier’s comment (e.g., a denial justification):

1# Access the denial comment
2message: data.approval_result.denied_by[0].comment
3
4# Access an approval comment
5message: data.approval_result.approved_by[0].comment

To enable a Deny with Comment button on the approval card, configure the approval buttons in Moveworks Setup > Approval Settings. This can be set at the integration level or global level.


batch_send_plaintext_chat_notification

Send a chat notification to one or more users. Use with batch_get_users_by_email to resolve user record IDs first.

Action Name: mw.batch_send_plaintext_chat_notification

Input Parameters:

ParameterTypeRequiredDescription
notificationsList[object]YesArray of notification objects, each containing user_record_id (string) and message (string)

Example:

1- action:
2 output_key: target_users
3 action_name: mw.batch_get_users_by_email
4 input_args:
5 user_emails:
6 - '''alice@example.com'''
7 - '''bob@example.com'''
8- action:
9 action_name: mw.batch_send_plaintext_chat_notification
10 output_key: notification_result
11 input_args:
12 notifications:
13 MAP():
14 items: data.target_users.user_records
15 converter:
16 user_record_id: item.user.record_id
17 message: '''Please complete your quarterly review.'''

Response Schema:

1{
2 "user_notification_tracker_details": [
3 {
4 "notification_tracker_uuid": "abc-123-def"
5 }
6 ]
7}

For sending interactive notifications with action buttons, use the notify compound action expression instead.


generate_text_action

Generate free-form text output using an LLM. Use for summarization, classification, formatting, and other text generation tasks.

Action Name: mw.generate_text_action

Input Parameters:

ParameterTypeRequiredDescription
user_inputstringYesThe input text for the LLM to process
system_promptstringNoInstructions for how the LLM should behave
modelstringNoModel to use (default: gpt-4o-mini-2024-07-18)
temperaturenumberNoSampling temperature (0-2)
imageFileNoOptional image input for multimodal processing
reasoning_effortstringNo"low", "medium", or "high" (reasoning models only)

Example:

1- action:
2 action_name: mw.generate_text_action
3 output_key: summary_result
4 input_args:
5 system_prompt: '''Summarize the following text in 2-3 sentences.'''
6 user_input: data.article_content
7 model: '''gpt-4o-mini'''
8 temperature: '0.7'

Response: data.summary_result.generated_output (string)

For full reference including supported models, see LLM Actions.


generate_structured_value_action

Generate structured JSON output matching a defined schema. Use for classification, entity extraction, and any task where you need typed output.

Action Name: mw.generate_structured_value_action

Input Parameters:

ParameterTypeRequiredDescription
payloadobjectYesThe input data for the LLM to process
output_schemastringYesJSON Schema defining the expected output structure. Must include additionalProperties: false on all objects.
system_promptstringNoInstructions for how the LLM should behave
modelstringNoModel to use (default: gpt-4o-mini-2024-07-18)
imageFileNoOptional image input for multimodal processing
reasoning_effortstringNo"low", "medium", or "high" (reasoning models only)

Example:

1- action:
2 action_name: mw.generate_structured_value_action
3 output_key: classification_result
4 input_args:
5 payload: data.customer_review
6 system_prompt: '''Analyze the sentiment of this review.'''
7 output_schema: >-
8 {
9 "type": "object",
10 "properties": {
11 "sentiment": {"type": "string", "enum": ["positive", "negative", "neutral"]},
12 "confidence": {"type": "number"}
13 },
14 "required": ["sentiment", "confidence"],
15 "additionalProperties": false
16 }

Response: data.classification_result.generated_output (object matching your schema)

For full reference including supported models, see LLM Actions.