You are here:
Distribute Flows to Automated Systems
Some flows don't require any user interaction to start. To enable a system to
automatically launch a flow you can use the start Apex method.
Most of these methods can be used only with an autolaunched flow. A flow
can be launched without user interaction, such as from the Apex
interview.start method. Autolaunched flows run in bulk and without user
interaction. They can't contain steps, screens, choices, or dynamic choices in the active or
latest flow version.
When a flow user invokes an autolaunched flow, the active flow version runs. If there’s no
active version, the latest version runs. When a flow admin invokes a flow, the latest version
always runs.
- Start a Flow from REST API
Use a REST call to run an autolaunched flow by using the invocable action endpoint and setting the path to flow. For example, you can run a flow from a non-Salesforce application or piece of code. The flow retrieves data from Salesforce and returns it as an output variable in your REST call. - Start a Flow from Apex
Flows started from Apex can include complex business logic and enhanced error handling, and can integrate with external systems more effectively. This approach promotes reusability by encapsulating logic within flows that can be called as needed. It also provides greater control over execution context and order of operations. The combination of Apex and flow helps you create more powerful and flexible apps that are easier to maintain.

