Skip to main content

Notifications

Dynamics 365 general forum

Schedule a workflow that runs on a bulk of records

Posted on by 293

Hi

I would like to schedule a workflow and make it runs on a selection of records. It could also run on all records I guess and add a condition in the workflow. 

EntityA has a DueDate field and a status field. On a daily basis, for each record in Entity A I want to check if DueDate is in the past, and if it, change the status. 

I know how to schedule a workflow to run daily but I don't know how to make it run for all records or for a selection of records. 

Thanks

Categories:
  • Suggested answer
    TylerS.Dev Profile Picture
    TylerS.Dev 725 on at
    RE: Schedule a workflow that runs on a bulk of records

    You can try the workflow scheduler developed by Lucas Alexander, see his Github site below:

    https://github.com/lucasalexander/AlexanderDevelopment.ProcessRunner/releases

    His solution creates a entity call recurring process which allows you to input fetchxml and run workflow on target records.

    I used this and it worked.  But note that from time to time the process is not triggered and you will have to reset the next starting time to resume scheduler.

  • Suggested answer
    nkhemji Profile Picture
    nkhemji 2 on at
    RE: Schedule a workflow that runs on a bulk of records

    You can create a custom workflow activity and schedule it or write a console app and schedule with task

  • Suggested answer
    Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: Schedule a workflow that runs on a bulk of records

    Hi

    The workflow does not support querying or looping through a list of records.  I have had a similar requirement to implement in a few past projects and please see below for the details on the approach I followed.

    01. Created Custom Workflow Activity that will use Query Expression to get all the records that need checking and then performs the update. - The CWA also took all the parameters

    02. I then Created workflow  and called the CWA created in Step 1 - This workflow won't trigger on any record events, its only set to be called as a child workflow

    03. The final step is to create a Workflow that runs on a scheduled basis and call the workflow created in step 02

  • Tessacq Profile Picture
    Tessacq 293 on at
    RE: Schedule a workflow that runs on a bulk of records

    Hi

    Sorry I forgot to mention, we are using on premises 8.2. The part I am more interested to solve is how to run it on all record / selection of records when it is schedule. I know how to solve the scheduling part (I have seen other post about it) and I know how to use a workflow in bulk on demand (using the XRM tools) but I don' know how to do both at the same time.

    Thanks

  • Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: Schedule a workflow that runs on a bulk of records

    Is your CRM environment Online or On-Prem?

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans