You can run a business policy at one minute intervals using a Periodic Invocation. 


Scenarios in which you would use a Periodic Invocation include:

  1. Processing newly created or updated records almost instantaneously without the need to set up an APEX trigger.
  2. Reassigning leads if reps do not follow up within a short period (less than one hour) 


If you need a periodic invocation with a frequency of more than one hour it is recommended to use a Scheduled Invocation


Creating a Periodic Invocation for your business policy

To schedule an invocation of a specific policy that runs every minute, go to the Periodic Invocations section on the policy detail page. Select 'New Invocation' 


You can enter the following:

  • Where Clause
    • This (optionally) allows you to select a subset of records to which the policy will be applied.
      For example, Industry = ’Insurance’ will select only records with the Industry field set to 'Insurance'.
      It is strongly recommended to use a restrictive condition -- running a job every minute on a large set of records will cause performance issues for your system.
    • The format of the where clause is defined by the SOQL language, see here for details.
    • To validate the syntax of your WHERE clause, press the Tab key or click outside of the text box.
  • Send email on completion?
    • Whether you would like to receive an email when the job completes or only if there is a failure or not at all.
    • Since this is a process that runs every minute it is unlikely that you will want 'Yes' unless the Where Clause limits the number of records that will be encountered on a daily basis.
  • Create execution record?
    • Whether you would like to create an execution record for the invoked records.
  • Batch Size
    • This specifies the number of records to process in one call to the Decisions on Demand server.

    • The default is 50 which works well for most cases. If you experience issues with governor limits you can reduce this to 25 or 10. 

    • If you need to speed up your processing you can try higher values -- the maximum is 2000.

  • Interval
    • Interval provides greater flexibility and can be set to run every minute. If you wish a number greater than 60 minutes please consider a Scheduled Invocation instead.


The example below invokes a policy every minute when the DecsOnD__Assignment_Status__c field is set to 'Ready' and the records belong to a particular user or queue. This Periodic Job will run with a batch size of 50, send an email on failure and create execution records:


Managing a Periodic Invocation

The newly scheduled job will appear in the Scheduled Invocations tab with a green checkmark:


You can also see the underlying Salesforce scheduled job: go to Setup and type 'Scheduled Jobs' into the Setup Quick Find box and then select it:


The Periodic Invocation will be visible along with all reporting snapshots, scheduled Apex jobs, and dashboards scheduled to refresh in the organization. Depending on how many jobs there are in the organization there might be scheduling conflicts that will delay the Periodic Invocation until prior jobs have completed. A maximum of 100 jobs are allowed per organization.


Once the Periodic Invocation has run you can click the View Report link on the right to see the 'Business Policies with Invocation Record' report. From there you can select an Invocation record to see what occurred during the most recent invocation of the job:


Go to the Batch Invocation Records section on the policy detail page to view all Invocation Records for the policy:


Depending on the option selected and the results of the invocation you may also receive an email:


You can also click the 'Stop' button to pause the Periodic Invocation from the Business Policy. For example, if there is maintenance on the system and you do not want the Periodic Invocation to run while that is occurring:


When you are ready for the Periodic Invocation to run again click the 'Start' button.