2
  • I have a schedule-triggered flow with a Wait element (wait 0 hours)
  • After the Wait element transpires, an invocable Apex is called

enter image description here

Setup > Process Automation Settings > Default Workflow User states

The default workflow user is required for scheduled paths in record-triggered flows and time-dependent actions in workflow rules. If the user who triggered the automation is no longer active, the default workflow user is associated with the actions that are executed by the automation. The default workflow user always runs schedule-triggered flows.

Yet when I turn the debug log on for default workflow user, no logging is done for the invocable Apex code.

What is the running user for the post-wait invocable Apex transaction so I can find the debug logs?

1 Answer 1

2

Turns out, the invocable Apex that executes after the wait timer expires is:

  • the default workflow user as expected
  • BUT, the debug log can only be found under the Automated Process User 😲

Here's the debug log proof

enter image description here

  • SFDC Automated Actions is my configured Default Workflow User
  • Line 3 (the oldest) is simply the scheduled flow starting on its schedule date
  • Line 2 (next oldest) are the Flow Interviews Create - Start - Finished up to the Wait element
  • Line 1 (most recent) is the invocable Apex and the following Flow elements that occur after the invocable apex (e.g. Send Email), followed by Flow Interview Finished

enter image description here

I could find no reference to this in the documentation. A 2022 SFDC Admin post Your Guide to Determining the Flow Running User and its Execution Context, while generally helpful was written before Wait elements were allowed in Schedule-triggered flows (Winter 24) and assumes that the running user is where one would find the debug logs

enter image description here

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.