You are here:
Best Practices for Drafting Flows with AI
Get the best results when using AI to build draft flows.
Required Editions
| Available in: Lightning Experience |
| View supported editions. |
| This feature requires the Foundations or Agentforce 1 editions. To purchase, contact your Salesforce account executive. |
Write Clear and Detailed Instructions
To build an accurate flow, AI needs clear and detailed instructions. Describe each step, including how to start the automation, specific types of records to process, and actions to take. When writing instructions:
- Start the instructions with “Create a flow.” Consider including the flow type. For example, “Create a screen flow.”
- Explain when the flow starts or describe the type of flow to create. For example, “...that starts when a contact is created...” or “...that has a screen...”
- Include criteria to use to identify specific records. For example, “...accounts with an annual revenue over $500,000...”
- Describe the actions you want the flow to take. For example, “...send an email to the case owner...”
- Use the names of objects and fields to use for criteria and actions. For example, “Create a flow that runs when an opportunity owner is updated...” instead of, “Create a flow that runs when the employee in charge of a sale is updated.”
- When creating external system change-triggered flows or flows with MuleSoft for Flow: Integration connectors as actions, write detailed prompts that include field-level instructions and mapping information. Generative AI maps fields between source and target systems, including mandatory fields, however, adding these details to your prompts ensures deterministic and predictable results.
Check for Accuracy and Safety
AI needs a human in the loop to ensure a flow is set up to complete the actions as intended and that it doesn’t contain problematic wording. After your draft flow opens in Flow Builder:
- Check each element and confirm it’s configured properly and doesn’t contain errors. For example, if you’re updating a field in the flow, ensure that the correct field name and new value are used in the Update Records element.
- If your flow includes outgoing messages, such as an email, check the language used in the message to ensure it doesn’t contain any harmful or unprofessional wording.
- Debug and test your flow to ensure it behaves the way you expect.
Provide Feedback
AI is still learning how to build accurate flows. Some flows that AI builds can be different from what you expect. When a flow is built incorrectly, your feedback about what’s wrong with the flow helps AI continue to improve and build increasingly accurate draft flows for you. To give feedback in the Flow Builder AI panel, click thumbs up or thumbs down. If you click thumbs down, please share details about why the flow didn’t meet your needs.
If at First You Don’t Succeed, Try New Instructions
If your draft flow needs minor tweaks to get it running correctly, edit your instructions. If the flow isn’t at all what you hoped for, start over with modified instructions. Seeing what your initial instructions produced gives you clues about how to change your instructions for your next attempt.

