---
schema_version: "1"
id: 3cf58e7ec0960cd2818a107fbd85bef6c2e2bf783219d521a15c434c8ee2f190
title: Creating Flow Formulas with Agentforce (Beta)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/flow_build_create_flow_formulas_with_einstein.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.flow_build_create_flow_formulas_with_einstein.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 4cede6bae96ca8926330c3b3e13aabed151b09916f877f0d9823c711e1c4bf48
description: Save time by using generative AI to build formulas in Flow Builder. Simply describe your formula and let Agentforce figure out the functions and operators.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Creating Flow Formulas with Agentforce (Beta)

Save time by using generative AI to build formulas in Flow Builder. Simply describe your formula and let Agentforce figure out the functions and operators.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_supported_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the editions and user interfaces that support Flow Builder. Some Flow Builder features integrate with other Salesforce products that require additional licenses.">View supported editions.</a></td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">This feature requires the Einstein for Sales, Einstein for Service, or Einstein Platform add-on. To purchase, contact your Salesforce account executive.</td></tr></tbody></table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_note.png)

Note Drafting a Flow and Formula with Agentforce is a pilot or beta service that is subject to the Beta Services Terms at [Agreements - Salesforce.com](https://www.salesforce.com/company/legal/agreements/) or a written Unified Pilot Agreement if executed by Customer, and applicable terms in the [Product Terms Directory](https://ptd.salesforce.com/). Use of this pilot or beta service is at the Customer's sole discretion.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:left;vertical-align:top;" id="d108901e96">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d108901e96 ">To open, edit, create, activate or
              deactivate a flow using all flow types, elements, and features available in Flow
              Builder, including Einstein and Agentforce for Flow:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d108901e96 ">Manage Flow</td>

          </tr>
        </tbody>
      </table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_note.png)

Note You don't need to be an admin to have the Manage Flow permission. Ask your admin to add it to your profile or permission set.

## Guidelines and Considerations for Creating Formulas with Agentforce (Beta)

Review our guidelines and considerations to get the best results when you’re using generative AI to create formulas.

### Write a Clear Description of Your Formula

To get an accurate formula, provide Agentforce with a detailed description. Review these example descriptions to get an idea of what type of information Agentforce is looking for.

 
| Description | Formula |
| --- | --- |
| Check to see if the `{!NumberOfEmployees}` field is set to zero. | `BLANKVALUE(NumberOfEmployees, 0).`. |
| Check if `{!$Event.EndDateTime}` is earlier than the current time | `{!$Event.EndDateTime} < NOW()` |
| Check if `{!$Opportunity.IsClosed}` is open and `{!$Opportunity.Amount}` is over $50,000. | `AND({!Opportunity.Amount} > 50000, {!Opportunity.IsClosed} = false)` |

To get the most accurate formula, when including a resource in your description, use the resource menu to select the resource instead of writing it in manually. To select a resource from the resource menu, click **Insert a resource…**.

### Check Your Formula for Accuracy and Safety

Agentforce needs a human in the loop to make sure a formula is set up correctly and doesn’t output problematic language. After your formula is created, review it for accuracy and safety, and check the syntax. Then, test it in your flow to make sure it works as expected.

### If Your Formula Doesn’t Work, Try Again

Agentforce can give a different result each time you click **Create** to create a formula. So, if your formula isn’t what you expect, try your description again to see if you can get a valid result. Otherwise, modify the formula, or start over with a new description.

### Consideration

Formulas created by Agentforce are available only in Flow Formula Builder. For example, they are not supported in Screen element input validation formulas.

## Create a Start Element Criteria Formula with Agentforce (Beta)

Quickly add formula entry criteria to a Start element with Agentforcegenerative AI.

Turn on [Einstein generative AI](https://help.salesforce.com/s/articleView?id=ai.generative_ai_enable.htm&language=en_US&type=5) in Setup. Then find and select **Process Automation Settings**, and enable formulas created by Einstein, and Agentforce flow automation (Beta).

1. In a flow, open the Start element.
2. In the Set Entry Conditions section, for Condition Requirements, select **Formula Evaluates to True**.
3. In the formula builder, click ![Agentforce button](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/platform_automation/images/flow/flow_einstein_formula_button.png).
4. Describe the formula you want to create and click **Create**.
    
    The formula appears in the area where you build a formula from scratch.
5. Check the syntax and test the formula before activating the flow.

## Create a Formula Resource with Agentforce (Beta)

Create a formula resource with ease by using Agentforce generative AI to create the formula.

Turn on [Einstein generative AI](https://help.salesforce.com/s/articleView?id=ai.generative_ai_enable.htm&language=en_US&type=5) in Setup. Then go to **Process Automation Settings**, and enable formulas created by Einstein and Agentforce flow automation (Beta).

1. In a flow, open the Toolbox and click **New Resource**.
2. For Resource Type, select **Formula**.
3. In the formula builder, click ![Einstein button](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/platform_automation/images/flow/flow_einstein_formula_button.png).
4. Describe the formula you want to create and click **Create**.
    
    The formula appears in the area where you build a formula from scratch.
5. Check the syntax and test the formula before activating the flow.

#### See Also

- [Considerations for Agentforce-Drafted Flows and Formulas (Beta)](https://help.salesforce.com/s/articleView?id=platform.automate_flow_build_einstein_considerations.htm&release=264.0.0&type=5 "Supported functionality, usage requirements, and important limitations when using Agentforce to draft flows and formulas.")