Limitations
- As with other Salesforce actions, the exact parameter set and behavior can change over time; confirm how this action behaves in your own environment before you depend on it for business-critical or large-scale opportunity creation.
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 and have permission to create Opportunity records.
Supported parameters
| Parameters | Type | Description |
|---|---|---|
| Account ID | String | Identifier of the related account. |
| Amount | Number | Monetary amount associated with the record. |
| Close date | String | Required. Expected or actual close date. |
| Contact ID | String | Identifier of the related contact. |
| Description | String | Additional details or notes about the opportunity. |
| Lead source | String | Source from which the lead or opportunity originated. |
| Name | String | Required. Name of the opportunity. |
| Next step | String | Planned next action or step for this opportunity. |
| Pricebook2 ID | String | Identifier of the associated price book. |
| Probability | Number | Probability (usually as a percentage) of winning. |
| Stage name | String | Required. Current stage of the opportunity. |
| Type | String | Type or category of the opportunity. |
Usage example
You need to create a new sales opportunity for a qualified prospect, linking it to their existing account and setting the initial stage and close date. Instruction to an agent: “Create a new opportunity in Salesforce for ABC Corp Enterprise License linked to the ABC Corp account with an amount of $150,000, close date March 31, 2026, stage Qualification, and probability 25%. Set the next step to Schedule product demo.” Resulting behavior:- Calls Search Salesforce with SOQL to find the Account for “ABC Corp”.
- Retrieves the Account ID (for example, “001xx000001234567”).
-
Calls Create opportunity with:
-
Nameset to “ABC Corp Enterprise License” (required). -
Account IDset to “001xx000001234567”. -
Amountset to 150000. -
Close dateset to “2026-03-31” (required). -
Stage nameset to “Qualification” (required). -
Probabilityset to 25. -
Next stepset to “Schedule product demo”.
-
- Creates a new Opportunity record in Salesforce linked to the ABC Corp account.
- Returns the Opportunity ID (for example, “006xx000001234567”).
- Confirms the opportunity was created successfully.
Troubleshooting
Salesforce Create opportunity action does not appear in the agent builder
Salesforce Create opportunity action does not appear in the agent builder
- Possible cause: The Salesforce action pack is not enabled or not linked to your Salesforce data source in the Glean admin console.
- Fix: In the Glean admin console, go to Platform → Actions, add the Salesforce action pack if needed, link it to your Salesforce datasource instance, configure authentication, update publish settings, and save. After that, Salesforce Create opportunity must appear under Actions → By datasource → Salesforce in the agent builder.
The action fails with an OAuth or connected account not found error
The action fails with an OAuth or connected account not found error
- Possible cause: The connected Salesforce account of the user is missing, inactive, or misconfigured, or the Salesforce connected app used for actions is not set up correctly.
- Fix: Ask the user to re-authenticate Salesforce when prompted by Glean. If errors persist, a Glean admin must verify the Salesforce connected app configuration including callback URL and scopes, confirm that the Salesforce actions setup steps are complete, and have the user retry the action.
Salesforce returns validation or required-field errors when creating opportunities
Salesforce returns validation or required-field errors when creating opportunities
- Possible cause: The agent prompts and field mappings into Salesforce Create opportunity do not match your Salesforce org’s schema, required fields, or validation rules, for example, required Opportunity fields such as Name, Close Date, or Stage name are not being populated.
- Fix: Review how your agent prompts and maps values into this action and confirm that your Salesforce org’s defaults, required fields, and validation rules align with how the agent is creating opportunities. Update either the agent configuration like field mappings and instructions or your Salesforce configuration so they match, then retest in a sandbox before rolling out broadly.
High-volume runs hit Salesforce API or connector limits
High-volume runs hit Salesforce API or connector limits
- Possible cause: The combination of this action, other Salesforce actions, and the Salesforce connector crawls is consuming a significant portion of your daily Salesforce API limit, or hitting connector-level size and throughput constraints.
- Fix: Coordinate with your Salesforce and Glean admins to review Salesforce API usage dashboards and the Salesforce connector configuration. Consider reducing run frequency, limiting batch sizes, or staggering schedules for high-volume agents, and start with sandbox validation before enabling large-scale automated opportunity creation.
FAQs
Does this action update existing opportunities, or only create new ones?
Does this action update existing opportunities, or only create new ones?
This action only creates new opportunity records in Salesforce. To change existing records, use Update Salesforce Opportunity or other update-focused Salesforce actions in your agent.
What fields are required to create an opportunity?
What fields are required to create an opportunity?
Three fields are required: Name, Close date, and Stage name. You will also typically need an Account ID to link the opportunity to an account. Use Salesforce Search or Search Salesforce with SOQL to find the Account ID first.
Can I use this action together with other Salesforce actions?
Can I use this action together with other Salesforce actions?
Yes. You can combine Salesforce Create opportunity with other Salesforce actions such as Create lead, Create contact, Send email, Log email activity, and Update Salesforce Opportunity to build complete sales workflows that create leads, contacts, opportunities, and track outreach in one coordinated run.
What happens if I have multiple Salesforce orgs connected?
What happens if I have multiple Salesforce orgs connected?
If you have multiple Salesforce orgs connected as separate data sources (for example, production and sandbox), the Salesforce action pack must be configured to use the correct instance to avoid creating opportunities in the wrong org. Check with your Glean admin to confirm the correct configuration.