Simple Actions

Using Actions

Actions are used to perform common tasks such as creating approval requests, looking up users, and more.

Any actions you build (e.g. HTTP actions or Script actions) will use the name of the action you defined when you first created them.

All native actions are preceded by the mw identifier, for example, if you want to use the create_generic_approval_request native action, you would use mw.create_generic_approval_request.

Action Reference

HTTP Action

HTTP Action enables integration with your systems through API calls that can be chained together in compound actions.

Script Action

Script Action leverages APIthon, a Python-based scripting environment, to empower users to sort/filter data, transform data, and perform complex calculations. This functionality is particularly useful for processing and manipulating data retrieved from API calls or other sources within your workflows.

  • Key Features:

    • Data Manipulation: Easily sort, filter, and transform data to meet the needs of your application or workflow.
    • Complex Calculations: Perform advanced calculations and data analysis directly within your scripts.
    • Python-Based: Utilizes APIthon, which is based on Python, providing a familiar and powerful scripting environment for developers.
    • Integration with Compound Actions: Scripts can be executed as part of compound actions, allowing for seamless integration with HTTP actions and other components of your system.
  • Useful Links:

Create Generic Approval Request

Create a Moveworks in-bot approval request.

Action Name: mw.create_generic_approval_request

Input Parameters:

  • approval_key (string): The approval key which describes the approval workflow. Currently Supported Keys (Required)
  • approval_details (string): The details that need approval. (Required)
  • users_requested_for (List[User]): Users who we are requesting approval for. (Required)

Request Schema:

{
  "approval_key": "string",
  "approval_details": "string",
  "users_requested_for": "List[User]"
}

Generate Structured Value Action

Call an LLM and have it produce a structured output.

Action Name: mw.generate_structured_value_action

Input Parameters:

  • payload (object): Payload to analyze when producing outputs. (Required)
  • output_schema (object): Output schema in JSON Schema format with type object, e.g. {"type": "object", "properties": {"name": {"type": "string"}}}}). For more information please check the OpenAI API docs (Required)
  • system_prompt (string): Instructions for the model on how to extract the value. If omitted, will use the default prompt (should be sufficient for most cases). (Optional)
  • strict (boolean): Whether to turn on Structured Outputs to have the model enforce strict adherence to the schema. Default false. If set to true, you will receive an error unless you also set "additional_properties" to false in output_schema and make all fields required (Optional)
  • output_schema_name (string): LLM-facing name for the schema. Defaults to "extracted_value". (Optional)
  • output_schema_description (string): LLM-facing description for the schema. (Optional)

Request Schema:

{
  "payload": "object",
  "output_schema": "object",
  "system_prompt": "string",
  "strict": "boolean",
  "output_schema_name": "string",
  "output_schema_description": "string"
}

Result Schema:

{
  "openai_chat_completions_response": {
    "choices": [
      {
        "message": {
          "content": "This is an example of structured content produced by the LLM."
        }
      }
    ]
  }
}

Generate Text Action

Call an LLM and have it produce some standard text.

Action Name: mw.generate_text_action

Input Parameters:

  • system_prompt (string): Optional message to set the model behavior. (Optional)
  • user_input (string): Context from the user which should be used in this specific generation. (Required)

Request Schema:

{
  "system_prompt": "string",
  "user_input": "string",
}

Result Schema:

{
  "openai_chat_completions_response": {
    "choices": [
      {
        "message": {
          "content": "This is an example of structured content produced by the LLM."
        }
      }
    ]
  }
}

Send Plaintext Chat Notification

Sends a chat notification to a user.

Action Name: mw.send_plaintext_chat_notification

Input Parameters:

  • user_record_id (string): The record ID of the user to notify. To retrieve user record IDs you need to use the Get User by Email or Look up multiple users by email native actions (Required)
  • message (string): The message to send. (Required)

Request Schema:

{
  "user_record_id": "string",
  "message": "string"
}

Summarize Text Action

Summarize a given text.

Action Name: mw.summarize_text_action

Input Parameters:

  • text_to_summarize (string): The text to summarize. (Required)

Request Schema:

{
  "text_to_summarize": "string"
}

Result Schema:

{
  "openai_chat_completions_response": {
    "choices": [
      {
        "message": {
          "content": "This is a summarized version of the text provided for summarization."
        }
      }
    ]
  }
}

Look up multiple users by email

Looksup 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:

{
  "user_emails": "List[string]",
}

Result Schema:

{
  "user_records": [
    {
      "lookup_id": "12345",
      "user": {
        "full_name": "John Doe",
        "email_addr": "[email protected]",
        ...
      }
    },
    {
      "lookup_id": "67890",
      "user": {
        "full_name": "Jane Smith",
        "email_addr": "[email protected]",
        ...
      }
    }
  ]
}

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.

Action Name: mw.get_user_by_email

Input Parameters:

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

Request Schema

{
  "user_email": "string"
}

Result Schema

{
  "user": {
    "full_name": "John Doe",
    "email_addr": "[email protected]",
    ...
  }
}

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