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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Does ExecuteWorkflowRequest run synchronously when wf is configured synchronous?

(0) ShareShare
ReportReport
Posted on by 4

Hello,

Scenario is that I want to generate a document template from code, to save it in SharePoint. I am using predefined "SetWordTemplate" action. I tried first to use it directly via OrganizationRequest like described here: https://crmtipoftheday.com/608/generate-documents-in-code/ , but while testing, I discover that it is not synchronous, I was not able to reach the created note right after the execution every time.

However, it seems to be working with synchronous workflow which I start from code with ExecuteWorkflowRequest. I reach the note every time after that request. I tested in a loop, executed request 10 times, deleting note every time right after the request.

I would like to confirm if the behavior will be consistent in all environments, also when system is under a pressure.

Thanks in advance

*This post is locked for comments

I have the same question (0)
  • Verified answer
    David Jennaway Profile Picture
    14,065 on at

    Whether a workflow runs asynchronously is determined by the workflow configuration, and not how it is run (automatic, OnDemand via UI, ExecuteWorkflowRequest). So yes, if the workflow is a synchronous workflow, then it will run synchronously via ExecuteWorkflowRequest

  • Suggested answer
    Arpit Shrivastava Profile Picture
    7,518 User Group Leader on at

    Hey Žarko,

    How workflow runs, it depends on the configuration you have done while creating the workflow. 

    ExecuteWorkflowRequest is just a call to trigger a particular workflow,

    As you said, your request is being called 10 times, this is due to your code is invoking ExecuteWorkflowRequest requests multiple times.

    Could you please tell, how you are running your code or on which event?

    -Arpit

  • Žarko Radevic Profile Picture
    4 on at

    Hi, thanks for quick response. I verified the same with custom workflow activity simulating long running task before "SetWordTemplate" action.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans