Salesforce Subflow Warning – Issue with Record-Triggered Flow?

visual-workflow

I found this question and answer where it is said that record triggered flow run with the System Mode (no sharing) Why "How to Run the Flow" option is not available in Record-Triggered Flows?

But when i execute a subflow that is set to run in System Mode (no sharing) from a record triggered flow i get the following warning:

The master flow is set to run in Default Mode. The referenced flow is
set to run in System Mode without Sharing.

Is the answer of that question still true and can i ignore this warning?

(I would have commented on that question but don't have the reputation for it…)

Best Answer

The Flow Metadata Documenation lists the various run modes (runInMode)

The context that the flow runs in. Valid values are:

  • DefaultMode — How the flow is launched determines whether the flow runs in user context or in system context. In the UI, this value appears as User or System Context—Depends on How Flow is Launched.

  • SystemModeWithSharing — The flow respects org-wide default settings, role hierarchies, sharing rules, manual sharing, teams, and territories. But the flow doesn’t respect object permissions, field-level access, or other permissions of the running user. In the UI, this value appears as System Context with Sharing—Enforces Record-Level Access.

The doc seems to be missing the latest addition which is SystemModeWithoutSharing.

However, going off the above and your specific scenario - the warning can be ignored. While it's technically true that the runInMode is mismatched, how the flow is run in default mode determines the context and, in your example (record-triggered), that would be System Mode (as the other answer notes) which matches your subflow's context.

For other situations, this warning may be useful if the flow is being run in a different manner which would cause the resolved contexts to mismatch.

Related Topic