Prerequisites
- Your Salesforce org must be connected as a data source in Glean, and an admin must enable the Salesforce action pack and complete Salesforce Actions Setup including OAuth configuration.
- Users must authenticate for Salesforce actions on first use.
- The Salesforce user must have permission to work with the relevant campaign and lead records.
Supported parameters
| Parameter | Type | Description |
|---|---|---|
| Campaign ID | String | The unique identifier of the Salesforce campaign to add the lead to. Required. |
| Lead ID | String | The unique identifier of the Salesforce lead to associate with the campaign. Required. |
| Status | String | Optional campaign member status representing how the lead engages with the campaign (e.g., “Sent”, “Responded”). |
Usage examples
- “Add lead ID 00QPZ000001rbt8YAA to the Q1 Product Launch campaign.”
- “Enroll the new lead in campaign ID 701PZ000002nrxyYAA with status ‘Sent’.”
- “Associate the prospect lead with the Webinar Attendees campaign.”
Troubleshooting
Action does not appear in the agent builder
Action does not appear in the agent builder
- Possible cause: The Salesforce action pack is not added or published in your Glean deployment.
- Fix: In the Glean admin console, go to Platform → Actions, add the Salesforce action pack, link it to your Salesforce datasource, configure authentication, update publish settings, and save. After that, Salesforce actions should appear under Actions → By datasource → Salesforce.
Action fails with OAuth or connected account error
Action fails with OAuth or connected account error
- Possible cause: The user’s connected Salesforce account is missing, inactive, or misconfigured, or the Salesforce connected app is not set up correctly.
- Fix: Ask the user to re-authenticate Salesforce when prompted by Glean. If errors persist, verify the Salesforce connected app configuration (callback URL and scopes) and confirm that Salesforce Actions Setup is complete.
Action succeeds but lead is not added to campaign
Action succeeds but lead is not added to campaign
- Possible cause: Salesforce rejected the request due to validation rules, missing required fields, insufficient permissions, or incorrect campaign or lead identifiers.
- Fix: Check agent run details and Salesforce error messages. Adjust required fields, validation rules, or user permissions. Verify that the campaign ID and lead ID are correct and that the user has access to both records.
Duplicate lead additions
Duplicate lead additions
- Possible cause: The action’s idempotency behavior may allow multiple additions of the same lead to the same campaign.
- Fix: Design your agent workflow to check if the lead is already a campaign member before calling this action. Validate the behavior in your Salesforce org before using in high-volume automated workflows.
FAQs
Is this a read or write action?
Is this a read or write action?
This is a write action. It sends a request to Salesforce to modify campaign-member data by associating a lead with a campaign.
Can I use this action with other Salesforce actions?
Can I use this action with other Salesforce actions?
Yes. You can combine this action with other Salesforce actions such as Create lead, Update lead, Search leads, List campaigns, Send email, and Log email activity in the same agent to create comprehensive workflows.
What happens if I add the same lead to a campaign multiple times?
What happens if I add the same lead to a campaign multiple times?
The idempotency behavior depends on your Salesforce configuration. In most cases, Salesforce will update the existing campaign member record rather than create a duplicate. Test this behavior in your org before deploying to production workflows.
Can I remove a lead from a campaign?
Can I remove a lead from a campaign?
This action only adds leads to campaigns. To remove a lead from a campaign, you would need to use a different Salesforce action or perform the operation directly in Salesforce.
How do I find the campaign ID?
How do I find the campaign ID?
You can find the campaign ID in Salesforce by navigating to the campaign record and copying the ID from the URL, or use the Search campaigns action to programmatically find the campaign ID based on campaign name or other criteria.