Provides a programmatic interface to the CFML scheduling
engine. Can run a CFML page at scheduled intervals, with the
option to write the page output to a static HTML page. This
feature enables you to schedule pages that publish data, such
as reports, without waiting while a database transaction is
performed to populate the page.

  <cfschedule action="delete" task="">

 cfschedule(action="delete", task="");

cfschedule Attribute Reference

action string

delete: deletes the specified task
update: updates an existing task or creates a new task,
if one with the name specified by the task attribute
does not exist
run: executes the specified task
pause: Pauses the specified task.
resume: Continues executing the specified task.
list: Lists all the scheduled tasks.
pauseall: CF 10+ Pauses all scheduled tasks.
resumeall: CF 10+ Resume all scheduled tasks for a particular application
  • delete
  • update
  • run
  • pause
  • resume
  • list
  • pauseall
  • resumeall

task string

Name of the task.

operation string

Operation that the scheduler performs. Must be HTTPRequest.

file string

Name of the file in which to store the published output of
the scheduled task

path string

Path to the directory in which to put the published file.

startdate string

Date on which to first run the scheduled task.

starttime string

Time at which to run the scheduled of task starts.


URL of the page to execute.

port numeric
Default: 80

Port to use on the server that is specified by the url
parameter. If resolveURL = "yes", retrieved document URLs
that specify a port number are automatically resolved, to
preserve links in the retrieved document. A port value in
the url attribute overrides this value.

publish boolean
Default: false

Yes: save the result to a file
No: does not

endDate string

Date when scheduled task ends.

endTime numeric

Time when scheduled task ends (seconds).

interval string

Interval at which task is scheduled.
* number of seconds (minimum is 60)
* once
* daily
* weekly
* monthly
  • once
  • daily
  • weekly
  • monthly

requesttimeout numeric

Deprecated as of CF 11+ used to extend the default timeout period.

username string

Username, if URL is protected.

password string

Password, if URL is protected.

proxyserver string

Host name or IP address of a proxy server.

proxyport numeric
Default: 80

Port number to use on the proxy server.

proxyuser string

User name to provide to the proxy server.

proxypassword string

Password to provide to the proxy server.

resolveurl boolean
Default: false

Yes: resolve links in the output page to absolute
No: does not

group string
Default: default

CF 11+ The group to which the scheduled task belongs.

mode string
Default: server

CF 10+ If the task is server-specific or application specific.
  • application
  • server

result (CF10+)/returnvariable (lucee) query

Name for the query in which cfschedule returns the result variables.

eventHandler string

CF 10+ A CFC file which implements CFIDE.scheduler.ITaskEventHandler and is invoked for events while running the task.
Note: CF 2018 Enterprise Required; not supported in Standard Edition

onException string
Default: invokeHandler, if eventHandler is specified

CF 10+ Specify the action to take if a task results in error.
Note: CF 2018 Enterprise Required; not supported in Standard Edition
  • refire
  • pause
  • invokeHandler

onComplete string
Default: invokeHandler

CF 10+ The action or task to perform after completion of the current task. Can be used to chain dependent tasks by executing a task after this task completes.
Note: CF 2018 Enterprise Required; not supported in Standard Edition

onMisfire string
Default: invokeHandler if eventHandler is specified

CF 10+ Specify what to do if a task misfires. If unspecified, then no action is taken.
Note: CF 2018 Enterprise Required; not supported in Standard Edition
  • fire_now
  • invokeHandler

cronTime integer

CF 10+ Schedule the task time in cron job syntax.

repeat string
Default: -1

CF 10+ Specify the number of times a given schedule has to repeat.

retryCount integer
Default: 3

CF 10+ Specify the number of times to retry the task if the task fails. Must be between 0 and 3, inclusive.
  • 0
  • 1
  • 2
  • 3

priority integer
Default: 5

CF 10+ Set the priority of this task.

exclude string

CF 10+ Comma-separated list of dates or date range on which to not execute the scheduled task.

cluster boolean
Default: no

CF 10+ If yes, the task can be executed in a cluster setup.
Note: CF 2018 Enterprise Required; not supported in Standard Edition

overwrite boolean
Default: true

CF 10+ Specify whether to overwrite the output files on task execution (if true) or create new output files (if false).

unique boolean

lucee4.5+ If true, the scheduled task is only executed once at time. If a task is still running from previous round no new task is started.

autodelete boolean

lucee4.5+ If set to true, the scheduled task will be deleted when there is no possible future execution.

readonly boolean

lucee4.5+ If true, the scheduled task can not be modified or deleted in the Lucee Administrator.

Examples sample code using the cfschedule tag

Tell ColdFusion to run 'importData.cfm' daily at 7AM

 startTime="7:00 AM"
 interval="daily" />

Delete the task 'importMyCSVFileToDB' from the list of ColdFusion scheduled jobs

 task="importMyCSVFileToDB" />

CF 10+ Instruct ACF not to execute the task on the set date, date range, or list of dates

 exclude="12/24/2019 TO 1/2/2020" />

CF 10+ Execute a task every 2 minutes from 3:00 AM to 10:00 AM and 9:00 PM to 11:58 PM daily

 cronTime="0 */2 3-10,21-23 * * ?" />

Fork me on GitHub