How to Configure a Scheduled Task in Cortex XSOAR
3969
Created On 04/01/20 17:42 PM - Last Modified 04/07/21 14:00 PM
Objective
You can run a command according to a recurring schedule, setting the start time, end time, and frequency. Some common use cases for scheduling a command to run include:
- Mirror a ticket from an external ticketing system.
- Send an email to a user, wait a certain amount of time, and if a response is not received, send the email again.
Important Notes
- Cron follows the time of the server that the script is running on.
- The clock icon for the task is blue when it is not scheduled, and orange when it is scheduled.
Unscheduled

Scheduled

Scheduled
Environment
Cortex XSOAR
Procedure
Input
Argument | Description | Required |
---|---|---|
command | Command to schedule | Required |
cron | Scheduled time for the command to run (in Cron format) | Required |
endDate | End time for the schedule to end (in Mon, 02 Jan 2019 15:04:04 EST format) | Optional |
times | Number of times to run the command | Optional |
Command Entries (UI)
- Locate the command entry in the War Room and click the clock icon.
- Configure the schedule for the task.
Option | Description |
---|---|
Human View |
|
Cron View |
|
Human View
Cron View
Demisto CLI
For this example, we use the two required arguments (command and cron) and an optional argument (times).
!ScheduleCommand command="!Print value=\"qqq\"" cron="*****" times="3"

!ScheduleCommand command="!Print value=\"qqq\"" cron="*****" times="3"
Script
return executeCommand("ScheduleCommand", {
'command': "!Print value=\"qqq\"",
'cron': '* * * * *',
'times': 3
}
'command': "!Print value=\"qqq\"",
'cron': '* * * * *',
'times': 3
}