web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Cannot process a workflow as Admin user

(0) ShareShare
ReportReport
Posted on by

Hello,

Can you please help me understan how to reun a workflow in the background as an Admin user? I am having the issue below:

I have created the following workflow for Opportunity entity, where my admin user is the Owner. This workflow is triggered automatically exits a certain Stage of the Opportunity Sales Process (BPF). As you can see, the workflow creates a Task  and inside is configured that another user is the owner of this task. When I, as a Admin user, run this workflow everything works. But if another user, not an Admin user, runs it, it cannot create the Task due to security role restrictions. And that´s ok, because this user should not have permission to create the task for another user, only to read it.

SharedScreenshot.jpg

So, the question is, how can i configure the workflow to run ALWAYS using my Admin User?

Thanks in advance, experts!

I have the same question (0)
  • Suggested answer
    Wahaj Rashid Profile Picture
    11,321 on at

    Hi,

    All the background workflows are executed as owner of the workflow.

    However, when you call a workflow from a BPF Stage (on-demand), it is executed under the user who is performing the action/logged in (not workflow owner/admin).

    Even if you set Execute as property of a real-time workflow, when executed on-demand (or BPF Stage), by design it will run under context of logged in user.

    To fix this, we have a couple of approaches:

    • Revisit Security roles: If you still want to keep user to have read-only privileges on Tasks of other users, Assign User Level create privileges and a higher level Append/Append To privileges on the Task entity to the end-user (this would allow user to create a task under his/her ownership and later assign it to other user). In the workflow, create Task under current user's ownership and later add a step to assign this Task to respective user. So user executing the workflow (BPF), will only have read-only privileges on the task.  
    • Trigger a background workflow on a change event: trick is to trigger a back-ground workflow by setting up a field's value from you on-demand workflow. Let's look at it as following:
      1. Create another background workflow to create a Task which triggers on a field change of the target entity.
      2. You call an on-demand workflow from BPF stage (executing under logged-in user's context).
      3. Set a field's value on the target entity.
      4. The workflow create in the step 1, will be executed under workflow owner's context and creates the task using workflow admin's privileges. 

    I hope one of above solutions, would work in your scenario.

    Best,

    Wahaj

    (if this helps, mark it verified)

  • Wahaj Rashid Profile Picture
    11,321 on at

    Hi Antanio,

    I have tested this scenario and updated my answer above based on my findings.

    Hope it helps.

    Best,

    Wahaj

  • Suggested answer
    Satish Tiwari - CRM Profile Picture
    on at

    Hello Antonio,

    Wajah has already shared couple of approaches that you can try and let us know if it worked. Just wanted to share the security context of workflow process -

    On-demand workflow - When a background workflow is configured as an on-demand process and is started by a user using the Run Workflow command, the actions that the workflow can perform are limited to those the user could perform based on the privileges and access levels defined by the security role(s) set for their user account.

    Background /Async workflow - When a background workflow starts based on an event the workflow operates in the context of the person who owns it, usually the person who created the workflow.

    Sync / Real-time workflow - For real-time workflows you have the Execute As option and you can choose whether the workflow should apply the security context of the owner of the workflow or the user who made changes to the record. If your workflow includes actions which all users would not be able to perform based on security constraints, you should choose to have the workflow run as the owner of the workflow.

  • Community Member Profile Picture
    on at

    Hi Rahid.

    Thank you for your quick response.

    I tried the first approach as this seems to me the most logical one, but still does not work even with the settings as you commented. Please let me know if something is missing for the permissions of this user (second line: Actividad=Task)

    pastedimage1595253508682v1.png

    Related to the second approach, i didnt get quite right. Can you send some screenshots (nothing too detailed), so I can move forward by myself?

    Once again, thanks. 

  • Wahaj Rashid Profile Picture
    11,321 on at

    Hi Antonio,

    Privileges seems to be fine, can you share a screenshot of Create Task Step from your workflow?

    Best,

    Wahaj

  • Wahaj Rashid Profile Picture
    11,321 on at

    Hi,

    For the second approach, let's assume you have a BPF on Opportunity Entity which calls an on-demand workflow on a specific stage.

    Now, lets do following steps:

    • Add two-options (boolean) field on Opportunity Entity, (lets say Create Task) and set it's default value to false.

    pastedimage1595257515224v7.png

    • Create a Background Worklfow on Opportunity Entity, which triggers on change of above field (Create Task):

    pastedimage1595257651453v8.png

    pastedimage1595257035597v2.png

    • Make sure owner of workflow is an admin (or a user with privileges to create task for others):

     pastedimage1595257145558v4.png

    • Now add a Create step and select Task entity. Configure the create step as per your need:

    pastedimage1595257735407v9.png

    Please note, I added a condition using flag to avoid duplicate creation of task (in case this flag is updated accidentally, this is optional and depends on your need). 

    • Activate the workflow.

    Now, open your on-demand workflow (which is called in BPF stage). Instead of creating a task, do following:

    • Add an update step to your entity (in my case this is opportunity) and set value of "Create Task" to "Yes".

    pastedimage1595258037094v11.png

    pastedimage1595258016783v10.png

    This update step, will trigger the background-workflow with workflow owner privileges.

  • Community Member Profile Picture
    on at

    Follows below:

    I split in 2 steps, as you have suggested, considering that the user only has permision to create his/her own Task and can assign (Append / Append to) to everyone.

    1) Create the task:

    pastedimage1595271101054v1.png

    2) Asign the task:

    pastedimage1595271147578v3.png

    This way, we can create the Task but the second step fails.

  • Wahaj Rashid Profile Picture
    11,321 on at

    Hi Antonio,

    Workflow configuration seems to be fine.

    I see you have given Assing Privileges on Business Unit Level. This means task can only be assigned to a user part of the same business unit (as of calling user).

    Can you please verify if the user you are assigning a task, is part of the same Business Unit? If not, you need to give Parent-Child Business Unit or Organization Level privileges on assign (depending upon your scenario).

    And when you say, you get the error in second step, can you please share the error details?

    Also, if you can't assign Organization level assign task privileges (depends on your security setup), i would suggest trying the second approach (create 2 workflows), I have added detailed steps.

    Please feel free to discuss.

    Thanks,

    Wahaj

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans