For the complete documentation index, see llms.txt. This page is also available as Markdown.

Schedule

Manages scheduled tasks in the BoxLang scheduler.

Component Signature

<bx:schedule action=[string]
task=[string]
scheduler=[string]
group=[string]
URL=[string]
class=[string]
method=[string]
interval=[string]
isDaily=[boolean]
cronTime=[string]
startDate=[string]
startTime=[string]
endDate=[string]
endTime=[string]
repeat=[integer]
exclude=[string]
port=[integer]
username=[string]
password=[string]
proxyServer=[string]
proxyPort=[integer]
proxyUser=[string]
proxyPassword=[string]
publish=[boolean]
path=[string]
file=[string]
overwrite=[boolean]
resolveUrl=[boolean]
retryCount=[integer]
onException=[string]
onComplete=[string]
eventhandler=[string]
cluster=[boolean]
result=[string] />

Attributes

Atrribute
Type
Required
Description
Default

action

string

true

task

string

false

scheduler

string

false

bxschedule

group

string

false

URL

string

false

class

string

false

method

string

false

run

interval

string

false

isDaily

boolean

false

false

cronTime

string

false

startDate

string

false

startTime

string

false

endDate

string

false

endTime

string

false

repeat

integer

false

exclude

string

false

port

integer

false

Optional HTTP port override for the URL. When omitted, the URL's own scheme determines the default port (e.g. 443 for https, 80 for http)

username

string

false

password

string

false

proxyServer

string

false

proxyPort

integer

false

proxyUser

string

false

proxyPassword

string

false

publish

boolean

false

false

path

string

false

file

string

false

overwrite

boolean

false

true

resolveUrl

boolean

false

false

retryCount

integer

false

3

onException

string

false

refire

onComplete

string

false

eventhandler

string

false

cluster

boolean

false

false

result

string

false

Examples

Create a scheduled task

Creates a new task that fires an HTTP GET request against a URL on a recurring interval.

Create a task that runs a BoxLang class

Instead of firing an HTTP request, point a task at a BoxLang class with class (mutually exclusive with url). The class is instantiated once and reused for the life of the task, and its run() method (or the method named by method) is invoked on every fire:

The class may optionally define any of before(), after(result), onSuccess(result), and onError(exception) — each is only invoked if defined, following the same convention as a BoxLang scheduler class's life-cycle methods:

A custom method name can be used instead of run():

Create a task with cron expression

Create a task that runs every 5 minutes

Update an existing task

Run a task immediately

Pause and resume a task

List all scheduled tasks

List tasks filtered by group

Pause or resume all tasks

Delete a scheduled task

Last updated

Was this helpful?