---
schema_version: "1"
id: b00d7f23801ee6a88dc4fc88efeb8cbec83bab27049feb636adf42f1004e4a23
title: Flow Run Context
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/flow_distribute_context.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.flow_distribute_context.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: a9ba3630939a33aafc898fe16a52be37db728d30c3b0a5fad46024847ac152ff
description: Flows run in user context or system context. For a flow running in user context, the running user’s profile and permission sets determine the object permissions and field-level access of the flow. For a flow that runs in system context, whether it runs with or without sharing determines its data access. Understanding context helps you control what your flows can read and update on behalf of your users.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Flow Run Context

Flows run in user context or system context. For a flow running in user context, the running user’s profile and permission sets determine the object permissions and field-level access of the flow. For a flow that runs in system context, whether it runs with or without sharing determines its data access. Understanding context helps you control what your flows can read and update on behalf of your users.

### 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;"><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></tbody></table>

The context a flow runs in affects what these flow elements can do with Salesforce data, including the records and fields they can read or update:

- Action
- Create Records
- Delete Records
- Get Records
- Subflow
- Update Records
- Any other flow element that accesses fields from a record

By default, a flow runs in user context or system context, depending on how the flow is launched. When a flow runs in system context, it runs in that context for all users, including users with the Guest User profile.

Default Run Context by Launch Method  
| Flow Launch Method | Default Context |
| --- | --- |
| Apex | Depends on code |
| Experience Cloud site | User |
| Embedded as a visual component inside a custom Aura component | User |
| Embedded as a visual component inside a Visualforce page | User |
| Custom button | User |
| Custom link | User |
| Direct link | User |
| Flow action | User |
| Lightning page | User |
| Platform event | System context without sharing |
| Process built in Process Builder | System context without sharing |
| Record-triggered | System context without sharing |
| REST API | User |
| Run from an Apex method of a custom Aura component controller | Depends on code |
| Run from an Apex method of a Visualforce controller | Depends on code |
| Schedule-triggered | System context without sharing |
| Web tab | User |

## Running User of a Flow

The running user of a flow is the user who launched the flow. The running user determines what a flow that runs in user context can do with Salesforce data.

For a flow running in user context, the running user’s profile and permission sets determine the object permissions and field-level access of the flow. When a flow attempts to create, read, edit, or delete Salesforce data, the flow enforces the running user’s permissions and field-level access. For example, if the running user doesn’t have the edit permission for the Account object, and the flow attempts to update account records, an error occurs.

Org-wide default settings, role hierarchies, sharing rules, manual sharing, teams, and territories also affect what data is accessible to flows that run in user context. If the org-wide default of the Opportunity object is private, and no opportunity records have been shared with the running user, the flow can’t read or edit any opportunity records.

By default, a flow in user context can inherit elevated permissions from a system-context caller, such as another flow or Apex. If a caller running in system context invokes your user-context flow, your flow also runs in system context. To make sure that your flow always runs with the running user’s access level regardless of its caller, select **User Context–Enforces User Permissions** in the flow version properties. This option is available for screen and autolaunched flows on API version 68.0 and later. See [Set Flow Run Context](https://help.salesforce.com/s/articleView?id=platform.flow_distribute_system_mode.htm&release=264.0.0&type=5 "Override the default run context of a flow to control what data it can access. Run a flow in system context with or without sharing, or enforce user-level access regardless of the caller.").

## Limitations

- Lightning components such as screen components and local actions always run in user context.
- If the context depends on code, Apex uses the `with sharing` and `without sharing` keywords to specify whether to enforce org-wide default settings, role hierarchies, sharing rules, manual sharing, teams, and territories.
- A flow called by Apex always ignores object and field-level access permissions.
- When a record-triggered flow, schedule-triggered flow, or process invokes an Apex invocable method from a class with inherited sharing, the method runs in system context with sharing. The flows and process run in system context without sharing.
- If a process triggers the flow to launch, the user who triggered the process sometimes requires other permissions. For example, if a process launches a flow that attempts to save permission set license assignments without the running user having Assign Permission Sets, an error occurs.
- A flow always runs in user context when it runs the Post to Chatter action.
- The standard user context option doesn't prevent a flow from inheriting elevated permissions from a system-context caller, such as another flow or Apex. To enforce user-level access regardless of the caller, use the User Context–Enforces User Permissions option. This option requires API version 68.0 or later and is available for screen and autolaunched flows only.

## In This Section

- **[Data Safety When Running Screen and Autolaunched Flows in System Context](https://help.salesforce.com/s/articleView?id=platform.flow_distribute_context_data_safety_system_context.htm&release=264.0.0&type=5)**  
    Screen flows and autolaunched flows without triggers can expose more data than intended. This potential issue primarily affects Experience Cloud sites accessed by external users. Configure proper user permissions for field-level and record-level security instead of running flows in system context. When system context is necessary, use only the minimum fields and records required.
- **[Set Flow Run Context](https://help.salesforce.com/s/articleView?id=platform.flow_distribute_system_mode.htm&release=264.0.0&type=5)**  
    Override the default run context of a flow to control what data it can access. Run a flow in system context with or without sharing, or enforce user-level access regardless of the caller.