salesforce-summarize-account-activity-history implementation guide

---
availability: INSTALLABLE
description: A plugin that allows users to summarize recent activities for an account
  (calls, tasks, events ,etc).
installation_asset_uuid: ed243073-639c-42a7-bccd-caba6b87e004
name: Summarize Recent Activity History for an Account
purple_chat_link: https://marketplace.moveworks.com/purple-chat?conversation=%7B%22messages%22%3A%5B%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22I+need+a+summary+of+one+of+my+accounts.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Certainly.+How+would+you+like+to+find+the+account%3F+Please+reply+with+the+number.%22%7D%2C%7B%22richText%22%3A%221.+Select+from+a+list+of+my+accounts%3Cbr+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22+%2F%3E2.+Search+by+account+name%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%221%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Retrieving+your+accounts+from+Salesforce.%22%7D%5D%7D%2C%7B%22richText%22%3A%22Here+is+a+list+of+your+accounts.+Which+one+would+you+like+a+summary+for%3F+Please+reply+with+the+number.%22%7D%2C%7B%22richText%22%3A%221.+Apex+Solutions%3Cbr+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22+%2F%3E2.+Global+Exports+Inc.%3Cbr+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22+%2F%3E3.+Innovatech+Builders%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%221%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Okay%2C+I+will+generate+a+summary+for+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EApex+Solutions%3C%2Fb%3E.+How+far+back+should+I+look+for+recent+activities%3F+You+can+reply+with+a+number+of+days+%28e.g.%2C+30%2C+90%29.%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%2230%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Querying+Salesforce+for+Apex+Solutions+summary+and+activities+for+the+last+30+days.%22%7D%5D%7D%2C%7B%22richText%22%3A%22Here+is+the+summary+for+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EApex+Solutions%3C%2Fb%3E%3A%3Cbr+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22+%2F%3E%3Cbr+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22+%2F%3E%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EKey+Contacts%3C%2Fb%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3EJohn+Smith%2C+VP+of+Operations%3C%2Fli%3E%3Cli%3EEmily+White%2C+Director+of+IT%3C%2Fli%3E%3C%2Ful%3E%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EOpen+Opportunities%3C%2Fb%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3EName%3A+Project+Highlander+Expansion%3C%2Fli%3E%3Cli%3EStage%3A+Proposal%2FPrice+Quote%3C%2Fli%3E%3Cli%3EAmount%3A+%24150%2C000%3C%2Fli%3E%3C%2Ful%3E%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ERecent+Activity+%28Last+30+Days%29%3C%2Fb%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3E%3Cb%3ESeptember+8%2C+2025+%28Call%29%3A%3C%2Fb%3E+Logged+by+Jane+Doe.+Subject%3A+%5C%22Discussed+Q4+implementation.%5C%22%3C%2Fli%3E%3Cli%3E%3Cb%3ESeptember+5%2C+2025+%28Event%29%3A%3C%2Fb%3E+Logged+by+John+Smith.+Subject%3A+%5C%22Project+Phoenix+Kick-off+Meeting.%5C%22%3C%2Fli%3E%3Cli%3E%3Cb%3EAugust+27%2C+2025+%28Task%29%3A%3C%2Fb%3E+Created+by+Jane+Doe.+Subject%3A+%5C%22Send+updated+pricing+sheet.%5C%22+Status%3A+%3Ci%3ECompleted%3C%2Fi%3E.%3C%2Fli%3E%3C%2Ful%3E%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EOpen+Support+Cases%3C%2Fb%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3ECase+%230018432%3A+Integration+question+regarding+API+limits.+Status%3A+%3Ci%3EPending+Engineering%3C%2Fi%3E.%3C%2Fli%3E%3C%2Ful%3EThis+is+the+complete+summary+for+the+account.%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22Apex+Solutions%22%7D%5D%7D%5D%7D%5D%7D
solution_tags:
- Sales
systems:
- salesforce
---

## Introduction

The “**Summarize Recent Activity History for an Account”** plugin allows users to instantly view a consolidated summary of recent activities related to a specific account, directly from Salesforce using the Moveworks AI Assistant. This enables teams to efficiently understand account activity, monitor progress, and stay coordinated without having to go through multiple Salesforce reports.

This guide will walk you through installing and configuring the plugin in **Agent Studio** in just a few minutes. Let’s get started!

## **Prerequisites**

- Access to Agent Studio

## **What are we building?**

### Agent Design

This [purple chat](https://marketplace.moveworks.com/purple-chat?conversation=%7B%22messages%22%3A%5B%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22I+need+a+summary+of+one+of+my+accounts.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Certainly.+How+would+you+like+to+find+the+account%3F+Please+reply+with+the+number.%22%7D%2C%7B%22richText%22%3A%221.+Select+from+a+list+of+my+accounts%3Cbr+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22+%2F%3E2.+Search+by+account+name%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%221%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Retrieving+your+accounts+from+Salesforce.%22%7D%5D%7D%2C%7B%22richText%22%3A%22Here+is+a+list+of+your+accounts.+Which+one+would+you+like+a+summary+for%3F+Please+reply+with+the+number.%22%7D%2C%7B%22richText%22%3A%221.+Apex+Solutions%3Cbr+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22+%2F%3E2.+Global+Exports+Inc.%3Cbr+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22+%2F%3E3.+Innovatech+Builders%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%221%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Okay%2C+I+will+generate+a+summary+for+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EApex+Solutions%3C%2Fb%3E.+How+far+back+should+I+look+for+recent+activities%3F+You+can+reply+with+a+number+of+days+%28e.g.%2C+30%2C+90%29.%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%2230%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Querying+Salesforce+for+Apex+Solutions+summary+and+activities+for+the+last+30+days.%22%7D%5D%7D%2C%7B%22richText%22%3A%22Here+is+the+summary+for+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EApex+Solutions%3C%2Fb%3E%3A%3Cbr+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22+%2F%3E%3Cbr+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22+%2F%3E%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EKey+Contacts%3C%2Fb%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3EJohn+Smith%2C+VP+of+Operations%3C%2Fli%3E%3Cli%3EEmily+White%2C+Director+of+IT%3C%2Fli%3E%3C%2Ful%3E%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EOpen+Opportunities%3C%2Fb%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3EName%3A+Project+Highlander+Expansion%3C%2Fli%3E%3Cli%3EStage%3A+Proposal%2FPrice+Quote%3C%2Fli%3E%3Cli%3EAmount%3A+%24150%2C000%3C%2Fli%3E%3C%2Ful%3E%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ERecent+Activity+%28Last+30+Days%29%3C%2Fb%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3E%3Cb%3ESeptember+8%2C+2025+%28Call%29%3A%3C%2Fb%3E+Logged+by+Jane+Doe.+Subject%3A+%5C%22Discussed+Q4+implementation.%5C%22%3C%2Fli%3E%3Cli%3E%3Cb%3ESeptember+5%2C+2025+%28Event%29%3A%3C%2Fb%3E+Logged+by+John+Smith.+Subject%3A+%5C%22Project+Phoenix+Kick-off+Meeting.%5C%22%3C%2Fli%3E%3Cli%3E%3Cb%3EAugust+27%2C+2025+%28Task%29%3A%3C%2Fb%3E+Created+by+Jane+Doe.+Subject%3A+%5C%22Send+updated+pricing+sheet.%5C%22+Status%3A+%3Ci%3ECompleted%3C%2Fi%3E.%3C%2Fli%3E%3C%2Ful%3E%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EOpen+Support+Cases%3C%2Fb%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3ECase+%230018432%3A+Integration+question+regarding+API+limits.+Status%3A+%3Ci%3EPending+Engineering%3C%2Fi%3E.%3C%2Fli%3E%3C%2Ful%3EThis+is+the+complete+summary+for+the+account.%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22Apex+Solutions%22%7D%5D%7D%5D%7D%5D%7D) shows the experience we are going to build.

## Installation Steps

While you can create a connector during plugin installation, we recommend setting up the connector in **Agent Studio** beforehand to streamline the process. Please follow our [**Salesforce Connector Guide**](https://marketplace.moveworks.com/connectors/salesforce?hist=home%2Cplgn.salesforce-create-campaign-inside-account%2Cbrws#how-to-implement) for detailed instructions. Once completed, proceed to install the plugin and complete the setup efficiently.

For this plugin, ensure the Salesforce integration user has the following permissions:

**Required Permissions:**

- **`Read access`** to the **Account, Contact, Task, Event, Case, Opportunity, and User** objects

After configuring the connector, refer to our [plugin installation documentation](https://help.moveworks.com/docs/ai-agent-marketplace-installation) for more details on completing the setup

## **Appendix**

### **API #1: Get All Accounts By Email**

```bash
curl --location 'https://<YOUR_INSTANCE>/services/data/v64.0/query/?q=SELECT+Id%2C+Name%2C+Type%2C+Industry%2C+CreatedDate+FROM+Account+WHERE+Id+IN+(SELECT+AccountId+FROM+Contact+WHERE+Email%3D%27{{EMAIL}}%27)+ORDER+BY+CreatedDate+DESC' \
--header 'Authorization: Bearer <ACCESS_TOKEN>'

```

**Query Parameters:**

- `EMAIL` (string) – The email address of the contact.

### **API #2 : Get Account ID by Account Name**

```bash
curl --location 'https://<YOUR_INSTANCE>/services/data/vXX.X/query/?q=SELECT+Id%2CName%2CAccountNumber%2CAccountSource%2CType%2CWebsite%2COwner.Name%2CIndustry%2CNumberOfEmployees%2CPhone+FROM+Account+WHERE+Name+LIKE+%27%{{ACCOUNT_NAME}}%%27+ORDER+BY+CreatedDate+DESC' \\

--header 'Authorization: Bearer <ACCESS_TOKEN>'
```

**Query Parameters:**

- `ACCOUNT_NAME` (String) - Used to filter the similar Accounts by Account name.

### API #3: Get Recent Tasks & Events for an Account

```bash
curl --location 'https://<YOUR_INSTANCE>/services/data/v64.0/composite/batch' \
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
  "batchRequests": [
    {
      "method": "GET",
      "url": "/services/data/v64.0/query?q=SELECT+Id,Name,Description,Type,Industry,LastActivityDate,LastModifiedDate+FROM+Account+WHERE+Id='\''{{ACCOUNT_ID}}'\''"
    },
    {
      "method": "GET",
      "url": "/services/data/v64.0/query?q=SELECT+Id,FirstName,LastName,Email,Phone,Title,Owner.Name,LastModifiedDate+FROM+Contact+WHERE+AccountId='\''{{ACCOUNT_ID}}'\''+AND+LastModifiedDate=LAST_N_DAYS:{{TIME_RANGE}}+ORDER+BY+LastModifiedDate+DESC"
    },
    {
      "method": "GET",
      "url": "/services/data/v64.0/query?q=SELECT+Id,Subject,ActivityDate,Status,Owner.Name,Who.Name,What.Name+FROM+Task+WHERE+WhatId='\''{{ACCOUNT_ID}}'\''+AND+LastModifiedDate=LAST_N_DAYS:{{TIME_RANGE}}+ORDER+BY+LastModifiedDate+DESC"
    },
    {
      "method": "GET",
      "url": "/services/data/v64.0/query?q=SELECT+Id,Subject,ActivityDate,Status,Owner.Name,Who.Name,What.Name+FROM+Task+WHERE+WhoId+IN+(SELECT+Id+FROM+Contact+WHERE+AccountId='\''{{ACCOUNT_ID}}'\'' )+AND+LastModifiedDate=LAST_N_DAYS:{{TIME_RANGE}}+ORDER+BY+LastModifiedDate+DESC"
    },
    {
      "method": "GET",
      "url": "/services/data/v64.0/query?q=SELECT+Id,Subject,ActivityDate,Status,Owner.Name,Who.Name,What.Name+FROM+Task+WHERE+WhatId+IN+(SELECT+Id+FROM+Opportunity+WHERE+AccountId='\''{{ACCOUNT_ID}}'\'' )+AND+LastModifiedDate=LAST_N_DAYS:{{TIME_RANGE}}+ORDER+BY+LastModifiedDate+DESC"
    },
    {
      "method": "GET",
      "url": "/services/data/v64.0/query?q=SELECT+Id,Subject,ActivityDate,DurationInMinutes,Owner.Name,Who.Name,What.Name+FROM+Event+WHERE+WhatId='\''{{ACCOUNT_ID}}'\''+AND+LastModifiedDate=LAST_N_DAYS:{{TIME_RANGE}}+ORDER+BY+LastModifiedDate+DESC"
    },
    {
      "method": "GET",
      "url": "/services/data/v64.0/query?q=SELECT+Id,Subject,ActivityDate,DurationInMinutes,Owner.Name,Who.Name,What.Name+FROM+Event+WHERE+WhoId+IN+(SELECT+Id+FROM+Contact+WHERE+AccountId='\''{{ACCOUNT_ID}}'\'' )+AND+LastModifiedDate=LAST_N_DAYS:{{TIME_RANGE}}+ORDER+BY+LastModifiedDate+DESC"
    },
    {
      "method": "GET",
      "url": "/services/data/v64.0/query?q=SELECT+Id,Subject,ActivityDate,DurationInMinutes,Owner.Name,Who.Name,What.Name+FROM+Event+WHERE+WhatId+IN+(SELECT+Id+FROM+Opportunity+WHERE+AccountId='\''{{ACCOUNT_ID}}'\'' )+AND+LastModifiedDate=LAST_N_DAYS:{{TIME_RANGE}}+ORDER+BY+LastModifiedDate+DESC"
    },
    {
      "method": "GET",
      "url": "/services/data/v64.0/query?q=SELECT+Id,CaseNumber,Subject,LastModifiedDate,Status,Priority,CreatedDate,ClosedDate,Owner.Name+FROM+Case+WHERE+AccountId='\''{{ACCOUNT_ID}}'\''+AND+LastModifiedDate=LAST_N_DAYS:{{TIME_RANGE}}+ORDER+BY+LastModifiedDate+DESC"
    },
    {
      "method": "GET",
      "url": "/services/data/v64.0/query?q=SELECT+Id,Name,StageName,LastModifiedDate,Amount,CloseDate,Owner.Name,CreatedDate+FROM+Opportunity+WHERE+AccountId='\''{{ACCOUNT_ID}}'\''+AND+LastModifiedDate=LAST_N_DAYS:{{TIME_RANGE}}+ORDER+BY+LastModifiedDate+DESC"
    }
  ]
}'
```

**Query Parameters:**

- `ACCOUNT_ID` (string) – Salesforce Account Id for which activities are being fetched.
- `TIME_RANGE` (integer) – Specifies how many previous days’ records should be retrieved.