Who is the "Current User" when a time based workflow fires in the future? I have Entitlement Milestone email alerts scheduled in the future, and the "From" (on behalf of) appears to be selected randomly. I have seen instances where it is not the creator or owner of the Case record being alerted on, nor did that user ever own or edit the record (from what I can see in the history).

I reference the current user twice in the template, once as the from, and once in the body of the message. It is a VF email template, that looks like this:

    subject="CASE: {!relatedTo.casenumber}  has exceeded 60% of SLA time"
    relatedToType="Case" >
<messaging:HtmlEmailBody >
   Please review and resolve. 
   {!relatedTo.Subject} Case {!relatedTo.CaseNumber} will exceed its SLA level on:<br/> 
   <apex:repeat value="{!relatedTo.casemilestones}" var="cm">
      <apex:outputfield value="{!cm.Milestonetype.name }" /> -
         <c:VFEmailDateTime date_time_value="{!cm.TargetDate}" />

   Submitting Agent: {!$User.FirstName} {!$User.LastName}<br/>
   Case Owner: {!relatedTo.Owner.Name}  {!IF(relatedTo.Owner.Type=="Queue","Queue","")}
   To access the case, use this link: <br/>

This random user also appears on the "Submitting Agent" line. I assumed it would be the user that caused the condition to be true for the milestone (and alert) to be queued.


2 Answers 2


According to my knowledge workflows are always run in context of user who triggered it.


This isn't particularly well documented, but from my investigations it will be the user that triggered the time based workflow (i.e. took the action that caused it to be queued) unless the user has been deactivated, in which case it will be the default workflow user.


The key section is:

When the user who triggered the rule isn’t active, Salesforce displays the username of the default workflow user in the Created By field for tasks, the Sending User field for email, and the Last Modified By field for field updates.

You must log in to answer this question.

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