1

According to the table in the middle of this Salesforce documentation, record-triggered Flows run in system-context. At the bottom of this unofficial sf documentation, it says record-triggered Flows run in user-context. I've performed testing in our org and at least one of our record-triggered Flows is running in user-context (see EDIT for details). What context do record-triggered flows run in?

I'm trying to determine which user(s) to assign a permission set to so that the Flow doesn't trigger a validation error when a record is updated.

EDIT:
A validation rule exists on the Account object. It checks for a custom permission and if the user doesn't have the custom permission, it throws an error. I logged in as a user without the custom permission and updated the Account which fired the record-triggered flow to update a field. The validation rule worked and prevented the update. I then assigned a perm set with the custom permission to the user and performed the previous steps again and the account updated successfully without triggering the validation rule. This seems to indicate that the record-triggered flow is in user-context.

6
  • 1
    System context without sharing salesforce.stackexchange.com/questions/348359/…
    – Elijah
    Dec 5, 2023 at 17:03
  • 2
    Does this answer your question? Why "How to Run the Flow" option is not available in Record-Triggered Flows?
    – Phil W
    Dec 5, 2023 at 17:16
  • 1
    Can you explain how you concluded that one of your record triggered flows was running in user context? Please edit the question to provide those details.
    – Phil W
    Dec 5, 2023 at 17:17
  • 3
    Explicit checking in validation rules for custom permissions does not mean the flow is running in user mode; such validation rules are always run and when they reference contextual user-related metadata always use that metadata (such as your custom permission). User mode would mean that the flow could not access fields and objects the user doesn't have CRUD/FLS or sharing access to, but that's not what happens with record triggered flows; these can access all objects, fields and records.
    – Phil W
    Dec 5, 2023 at 18:02
  • 1
    Note that the solution part to your question goes in the box below titled "Your Answer." We are in a Q&A format, so placing the answer in the question area can make it harder for people to find the answer. Also, Phil's right on this one.
    – sfdcfox
    Dec 5, 2023 at 18:03

1 Answer 1

5

Explicit checking in validation rules for custom permissions does not mean the flow is running in user mode; such validation rules are always run and when they reference contextual user-related metadata always use that metadata (such as your custom permission).

User mode would mean that the flow could not access fields, objects or records the user doesn't have CRUD/FLS or sharing access to, but that's not what happens with record triggered flows; these can access all objects, fields and records.

As per this Q&A and the related official documentation, all record triggered flows run in System mode, without sharing.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .