Search code examples
crondynamics-crmscheduling

Dynamics CRM: Scheduling workflows


In my CRM I've applications which should be checked and processed by a workflow once a minute. I was wondering if there anyway to automate this stuff using some sort of cron task or scheduling. I'm relatively new to CRM.

What should I do to make the stuff above, using standard CRM tools, or third party plugins?

Sultan.


Solution

  • CRM doesn't have a good way of handling this. Here are the options generally available inside CRM:

    1. Create a workflow that runs, checks what you need it to do, waits for a period of time and calls itself recursively. If the interval you needed to check at was longer than a minute, this might work, however, CRM has loop detection built into the workflows, and running them once a minute will definitely trigger that.
    2. Create an entity that represents one of your processes. Create a workflow that kicks off after create of this entity, waits one minute, and then creates a new record of your entity. This way, the workflow isn't calling itself recursively and it shouldn't trigger CRM's loop detection. However, you're creating a lot of dummy records and workflow instances that you'll need to clean up in this scenario.

    I think both of these are kind of hacky. I would say that if you need to check something once every minute, I'd put it outside CRM in a Windows Service or a Scheduled Task. CRM just doesn't have this capability built in.