salesforce-create-follow-up-task-for-lead implementation guide

---
availability: INSTALLABLE
description: A plugin that allows users to create a new task for a lead.
installation_asset_uuid: 27caf9dc-babd-4ac7-860b-4b14ddc10c68
name: Create a Task for a Lead
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%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EI+want+to+make+a+task+for+a+lead%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Okay%2C+I+can+help+you+create+a+Salesforce+task+for+a+lead.+Would+you+like+to+see+your+assigned+leads%2C+or+search+for+a+specific+lead%3F%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Search+for+a+lead%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ENo+problem.+Please+enter+the+lead+or+company+name.%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EDavis%3C%2Fp%3E%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%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESearching+for+leads+matching+%27Davis%27+in+%3Cb%3ESalesforce%3C%2Fb%3E%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EHere+are+the+leads+matching+%27Davis%27%3A%3C%2Fp%3E%3Col+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3E%3Cp%3ESarah+Davis+-+Global+Exports+Inc.%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3EJohn+Davis+-+Tech+Solutions%3C%2Fp%3E%3C%2Fli%3E%3C%2Fol%3E%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EWhich+one+is+this+task+for%3F%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22Sarah+Davis%22%7D%2C%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22John+Davis%22%7D%5D%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%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EIdentifying+selected+lead%3A+Sarah+Davis%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EOkay%2C+I%27ve+selected+%3Cb%3ESarah+Davis%3C%2Fb%3E.+To+create+the+Salesforce+task%2C+I+need+a+few+more+details%3A%3C%2Fp%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3E%3Cb%3ESubject%3A%3C%2Fb%3E+What+is+the+subject+of+this+task%3F%3C%2Fli%3E%3Cli%3E%3Cb%3EAssignee%3A%3C%2Fb%3E+Who+should+be+assigned+this+task%3F+You+can+provide+the+assignee%E2%80%99s+name+or+email.%3C%2Fli%3E%3Cli%3E%3Cb%3EDue+date%3A%3C%2Fb%3E+Please+provide+the+date+this+task+should+be+completed.%3C%2Fli%3E%3C%2Ful%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESubject%3A+Follow+up+on+proposal%2C+Assignee%3A+John%2C+Due%3A+Tomorrow%3C%2Fp%3E%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%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESearching+for+users+matching+%27John%27+in+%3Cb%3ESalesforce%3C%2Fb%3E%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EI+found+a+few+users+named+John.+Which+one+is+the+assignee%3F%3C%2Fp%3E%3Col%3E%3Cli%3E%3Cp%3EJohn+Smith%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3EJohn+Doe%3C%2Fp%3E%3C%2Fli%3E%3C%2Fol%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22John+Smith%22%7D%2C%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22John+Doe%22%7D%5D%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%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EIdentifying+selected+assignee%3A+John+Smith%3C%2Fp%3E%22%7D%2C%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EParsing+input%3A+Subject+%27Follow+up+on+proposal%27%2C+Due+Date+%27Tomorrow%27+as+August+13%2C+2025%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EPlease+review%3A+I+will+create+a+task+with+the+subject+%3Cb%3E%27Follow+up+on+proposal%27%3C%2Fb%3E+for+the+lead+%3Cb%3ESarah+Davis%3C%2Fb%3E%2C+assigned+to+%3Cb%3EJohn+Smith%3C%2Fb%3E%2C+and+due+%3Cb%3Etomorrow%2C+August+13%2C+2025%3C%2Fb%3E.+Is+this+correct%3F%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Yes%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%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ECreating+task+for+Sarah+Davis+in+%3Cb%3ESalesforce%3C%2Fb%3E%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EDone.+I+have+created+the+new+task+in+Salesforce+and+linked+it+to+Sarah+Davis.%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22Task%3A+Follow+up+on+proposal%22%7D%5D%7D%5D%2C%22showFeedbackTray%22%3Atrue%7D%5D%7D
solution_tags:
- Sales
systems:
- salesforce
---

## **Introduction**

The **“Create a Task for a Lead”** plugin makes it easy to schedule tasks for your sales leads directly in the Moveworks AI Assistant. The plugin automatically creates the task for you, ensuring no lead is missed, helping sales teams stay organized, and improving task management without the need for manual work.

This guide will show you how to quickly list leads by assignee, select the right lead, and create a customized task in Agent Studio. 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%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EI+want+to+make+a+task+for+a+lead%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Okay%2C+I+can+help+you+create+a+Salesforce+task+for+a+lead.+Would+you+like+to+see+your+assigned+leads%2C+or+search+for+a+specific+lead%3F%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Search+for+a+lead%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ENo+problem.+Please+enter+the+lead+or+company+name.%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EDavis%3C%2Fp%3E%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%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESearching+for+leads+matching+%27Davis%27+in+%3Cb%3ESalesforce%3C%2Fb%3E%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EHere+are+the+leads+matching+%27Davis%27%3A%3C%2Fp%3E%3Col+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3E%3Cp%3ESarah+Davis+-+Global+Exports+Inc.%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3EJohn+Davis+-+Tech+Solutions%3C%2Fp%3E%3C%2Fli%3E%3C%2Fol%3E%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EWhich+one+is+this+task+for%3F%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22Sarah+Davis%22%7D%2C%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22John+Davis%22%7D%5D%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%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EIdentifying+selected+lead%3A+Sarah+Davis%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EOkay%2C+I%27ve+selected+%3Cb%3ESarah+Davis%3C%2Fb%3E.+To+create+the+Salesforce+task%2C+I+need+a+few+more+details%3A%3C%2Fp%3E%3Cul+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3E%3Cli%3E%3Cb%3ESubject%3A%3C%2Fb%3E+What+is+the+subject+of+this+task%3F%3C%2Fli%3E%3Cli%3E%3Cb%3EAssignee%3A%3C%2Fb%3E+Who+should+be+assigned+this+task%3F+You+can+provide+the+assignee%E2%80%99s+name+or+email.%3C%2Fli%3E%3Cli%3E%3Cb%3EDue+date%3A%3C%2Fb%3E+Please+provide+the+date+this+task+should+be+completed.%3C%2Fli%3E%3C%2Ful%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESubject%3A+Follow+up+on+proposal%2C+Assignee%3A+John%2C+Due%3A+Tomorrow%3C%2Fp%3E%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%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ESearching+for+users+matching+%27John%27+in+%3Cb%3ESalesforce%3C%2Fb%3E%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EI+found+a+few+users+named+John.+Which+one+is+the+assignee%3F%3C%2Fp%3E%3Col%3E%3Cli%3E%3Cp%3EJohn+Smith%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3EJohn+Doe%3C%2Fp%3E%3C%2Fli%3E%3C%2Fol%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22John+Smith%22%7D%2C%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22John+Doe%22%7D%5D%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%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EIdentifying+selected+assignee%3A+John+Smith%3C%2Fp%3E%22%7D%2C%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EParsing+input%3A+Subject+%27Follow+up+on+proposal%27%2C+Due+Date+%27Tomorrow%27+as+August+13%2C+2025%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EPlease+review%3A+I+will+create+a+task+with+the+subject+%3Cb%3E%27Follow+up+on+proposal%27%3C%2Fb%3E+for+the+lead+%3Cb%3ESarah+Davis%3C%2Fb%3E%2C+assigned+to+%3Cb%3EJohn+Smith%3C%2Fb%3E%2C+and+due+%3Cb%3Etomorrow%2C+August+13%2C+2025%3C%2Fb%3E.+Is+this+correct%3F%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Yes%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%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ECreating+task+for+Sarah+Davis+in+%3Cb%3ESalesforce%3C%2Fb%3E%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3EDone.+I+have+created+the+new+task+in+Salesforce+and+linked+it+to+Sarah+Davis.%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22salesforce%22%2C%22citationTitle%22%3A%22Task%3A+Follow+up+on+proposal%22%7D%5D%7D%5D%2C%22showFeedbackTray%22%3Atrue%7D%5D%7D) shows the experience we are going to build.

## **Installation Steps**

We recommend creating the connector for **Salesforce** first, prior to installing this plugin. Please follow the  [Salesforce Connector](https://marketplace.moveworks.com/connectors/salesforce#how-to-implement) guide to set up the connector.

**Object Access**:

- `Read` and `Create` access to the **Task** object
- `Read` access to the **Lead** object

After you have configured the connector, Please refer to our [plugin installation documentation](https://help.moveworks.com/docs/ai-agent-marketplace-installation) for more details on how to install a plugin in Agent Studio.

## **Appendix**

### **API #1 : Get Leads by Email**

```bash
curl --location 'https://<your-instance>/services/data/v59.0/query/?q=SELECT+Id%2C+Name%2C+Title%2C+Company%2C+Email%2C+Owner.Name%2C+Status%2C+Phone%2C+Street%2C+City%2C+State%2C+PostalCode%2C+Country%2C+LastModifiedDate+FROM+Lead+WHERE+Owner.Email%3D%27{{ownerEmail}}%27+AND+IsConverted%3Dfalse+ORDER+BY+LastModifiedDate+DESC' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your-access-token>'
```

**Query Parameters**

- `ownerEmail` - Search by Lead Owner’s Email.

### **API #2 : Get Leads by Name**

```bash
curl --location 'https://<your-instance>/services/data/v59.0/query/?q=SELECT+Id%2CName%2CTitle%2CCompany%2CEmail%2COwner.Name%2CStatus%2CPhone%2CStreet%2CCity%2CState%2CPostalCode%2CCountry%2CLastModifiedDate+FROM+Lead+WHERE+Name+LIKE+%27%25{{name}}%25%27+AND+IsConverted%3Dfalse+ORDER+BY+LastModifiedDate+DESC+LIMIT+50' \
--header 'Authorization: Bearer <your-access-token>'
```

**Query Parameters**

- `name`  - Search for a specific lead by name.

### **API #3 :** **Get Leads by C**ompany

```bash
curl --location 'https://<your-instance>/services/data/v59.0/query/?q=SELECT+Id%2CName%2CTitle%2CCompany%2CEmail%[2COwner.Name](http://2cowner.name/)%2CStatus%2CPhone%2CStreet%2CCity%2CState%2CPostalCode%2CCountry%2CLastModifiedDate+FROM+Lead+WHERE+Company+LIKE+%27%25{{company}}%25%27+AND+IsConverted%3Dfalse+ORDER+BY+LastModifiedDate+DESC+LIMIT+50' \
--header 'Authorization: Bearer <your-access-token>'
```

**Query Parameters**

- `company` - Search by company name to retrieve lead details.

### **API #4 : Create Follow Up Task**

```bash
curl --location 'https://<your-instance>/services/data/vXX.X/sobjects/Task/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your-access-token>' \
--data '{
"Subject": "{{Subject}}",
"WhoId": "{{LeadId}}",
"ActivityDate": "{{date}}",
"OwnerId": "{{UserId}}"
}'
```

**** **Request Body Parameters**

- `Subject`  - The lead can provide the subject name for the task.
- `LeadId`  - Retrieves the active lead based on the user’s input and fetches its ID.
- `date`  - The lead can specify the due date for the task.
- `UserId`  - assign the user who owns the task.

### **API #5 : Get User By Name**

```bash
curl --location 'https://<your-instance>/services/data/v61.0/query/?q=SELECT+Id,Name,Email+FROM+User+WHERE+Name+LIKE+%27%25{{name}}%25%27+AND+UserType=Standard+LIMIT+10' \
--header 'Authorization: Bearer <your-access-token>'
```

**Query Parameters**

- `name` - Search by name to retrieve user details.

### **API #6 : Get User By Email**

```bash
curl --location 'https://<your-instance>/services/data/v61.0/query/?q=SELECT+Id%2C+Name%2C+Email+FROM+User+WHERE+Email+LIKE+%27%25{{email}}%25%27+LIMIT+10' \
--header 'Authorization: Bearer <your-access-token>'
```

**Query Parameters**

- `email`  - Search by email to retrieve specific user details.