Choose Running User for Platform Event-Triggered Flows

Choose Running User for Platform Event-Triggered Flows

Last Updated on May 30, 2024 by Rakesh Gupta

Big Idea or Enduring Question:

  • How can you execute flows triggered by platform events for different users?

Objectives:

After reading this blog, you will understand:

  1. What Platform Events are
  2. How to configure the running user for platform event-triggered flows
  3. And much more

What is Platform Events?

Event-driven architectures have become very popular in recent years, and for a good reason. It is based on the fire-and-forget pattern. Firing an event and letting each system handle business logic allows you to keep unrelated systems decoupled and can help simplify the architecture.

Platform events enable you to deliver secure, scalable, and customizable event notifications within Salesforce or from external sources. Apps can publish and subscribe to Platform Events on the Salesforce platform using Apex, Flow, or in an external system using CometD. If you want to learn more about Platform Event, check out the Trailhead Module.

Guided Practice (We-do):

Choose whether to run event-triggered flows as the user who triggered the flow or as your organization’s default workflow user. If you select the default workflow user, any changes made by the flow will be attributed to this user, no matter who originally triggered the flow.

Follow these steps to configure the running user for a platform event-triggered flow:

Step 1: Define Flow Properties

  1. Click Setup.
  2. In the Quick Find box, type Flows.
  3. Select Flows, then click on the New Flow.
  4. Select the Start from Scratch option, then click on the Next.
  5. Select the Platform Event—Triggered Flow.
  6. Click on Create.

Step 2: Select Running User

  1. Click Start element.
  2. Under the Advanced Settings section and select who to run the flow as:
  3. Click the X at the top to save your changes.

Running as the default workflow user can help if your flows fail due to mixing callouts and DML operations. Read this article to learn how to set up the batch size and override the default running user for platform event triggers.

Formative Assessment:

I want to hear from you!

What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? Feel free to share in the comments below.

Go back

Your message has been sent

Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

Warning
Warning
Warning
Warning
Preferred Timing(required)

Warning
Warning

Warning.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.