Simple Scheduled Task
Simple scheduled tasks are used to define schedules for the execution of data flows.
The results of the executed schedules are stored in execution plan states which are contained in the scheduled task.
Note
|
To access the Simple Scheduled Tasks API the AutomationServices license feature must be enabled and the API user must have the maintainSchedule feature permission specified as part of their role. |
For help with simple scheduled tasks see the related tutorials.
Create a simple scheduled task
A POST
request creates a simple scheduled task.
Request Parameters
Parameter | Description |
---|---|
|
The container locator of the requested scheduled tasks. |
|
The authentication token. |
Request Fields
Path | Type | Description |
---|---|---|
|
|
The identity of the scheduled task. It must be unique and will be allocated if not specified at creation. |
|
|
The name of the scheduled task. This must be unique in the container. |
|
|
The description of the scheduled task. |
|
|
true if schedule is enabled, defaults to true. |
|
|
The Run Property Set for the Scheduled Task |
|
|
A list of run properties. |
|
|
The name of the run property. |
|
|
The value of the run property. |
|
|
The name of the run property. |
|
|
The value of the run property. |
|
|
Trigger Properties e.g. 'cronExpression'. |
|
|
Quartz Cron Expression. |
|
|
The date and time when the schedule starts in ISO-8601 format. |
|
|
The date and time when the schedule ends in ISO-8601 format. |
|
|
List of follow up actions taken on completion of Data Flow execution. |
|
|
Specifies whether the follow up action is enabled or not. |
|
|
Condition on which to execute the follow up action. SUCCEEDED - execute if previous data flow succeeded, FAILED - execute if previous data flow failed. |
|
|
Action to take. |
|
|
Type of action: executeDataFlowFollowUpAction - execute a data flow, sendEmailFollowUpAction - send an email to a specified list of recipients. |
|
|
Information specific to the action. |
|
|
Locator of data flow to execute when executeDataFlowFollowUpAction is specified. |
|
|
Optional Run Property Set to use with follow up data flow when executeDataFlowFollowUpAction is specified. |
|
|
List of email recipients when sendEmailFollowUpAction is specified. |
Response Fields
Path | Type | Description |
---|---|---|
|
|
Object resource locator. Used to identify the resource. |
|
|
Status of the response. One of: |
Example request
In this example the follow-ups are configured to execute another data flow if the scheduled data flow succeeds and to send an email if either data flow fails to execute.
POST /api/v4/simple-scheduled-tasks?container=object:!tenant:defaultTenant~directory:workspace-id<k=AUTHENTICATION_TOKEN HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Type: application/json;charset=UTF-8
Content-Length: 1230
Host: localhost:8080
{"id":"simple-scheduled-task-v4-id","name":"Schedule Name","description":"Schedule Description","enabled":false,"triggerProperties":{"cronExpression":"0 00 00 1 1/1 ? *","startDateTime":"Start Date is ISO 8601 format","endDateTime":"Start Date is ISO 8601 format"},"dataflowId":"dataflowId","dataflowLocator":null,"runPropertySet":{"id":null,"name":null,"runProperties":[{"name":"runPropertyName1","value":"runPropertyValue1","source":null,"dataType":null,"editorData":null,"managementData":null},{"name":"runPropertyName2","value":"runPropertyValue2","source":null,"dataType":null,"editorData":null,"managementData":null}],"parentRunPropertySetLocators":null,"lastKnownParentNames":null,"description":null},"searchPath":["object:!tenant:defaultTenant~directory:workspace-id"],"runAsUserLocator":"object:!tenant:defaultTenant~user:runAsUser","followUps":[{"condition":"SUCCEEDED","action":{"type":"executeDataFlowFollowUpAction","data":{"runPropertySet":null,"dataflowLocator":"object:!tenant:defaultTenant~directory:workspace-id~graph:followUpGraphId"}},"enabled":true},{"condition":"FAILED","action":{"type":"sendEmailFollowUpAction","data":{"emailDistributionList":["user1@company.com","user2@company.com"]}},"enabled":false}]}
Example response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 152
{
"status" : "OK",
"data" : {
"locator" : "object:!tenant:defaultTenant~directory:workspace-id~scheduled-task:simple-scheduled-task-v4-id"
}
}
Update a simple scheduled task
A PUT
request updates a simple scheduled task.
Path Parameters
Parameter | Description |
---|---|
|
The locator for the scheduled task to update. |
Request Parameters
Parameter | Description |
---|---|
|
The authentication token. |
Request Fields
Path | Type | Description |
---|---|---|
|
|
The identity of the scheduled task. It must be unique and will be allocated if not specified at creation. |
|
|
The name of the scheduled task. This must be unique in the container. |
|
|
The description of the scheduled task. |
|
|
true if schedule is enabled, defaults to true. |
|
|
The Run Property Set for the Scheduled Task |
|
|
A list of run properties. |
|
|
The name of the run property. |
|
|
The value of the run property. |
|
|
The name of the run property. |
|
|
The value of the run property. |
|
|
Trigger Properties e.g. 'cronExpression'. |
|
|
Quartz Cron Expression. |
|
|
The date and time when the schedule starts in ISO-8601 format. |
|
|
The date and time when the schedule ends in ISO-8601 format. |
|
|
List of follow up actions taken on completion of Data Flow execution. |
|
|
Specifies whether the follow up action is enabled or not. |
|
|
Condition on which to execute the follow up action. SUCCEEDED - execute if previous data flow succeeded, FAILED - execute if previous data flow failed. |
|
|
Action to take. |
|
|
Type of action: executeDataFlowFollowUpAction - execute a data flow, sendEmailFollowUpAction - send an email to a specified list of recipients. |
|
|
Information specific to the action. |
|
|
Locator of data flow to execute when executeDataFlowFollowUpAction is specified. |
|
|
Optional Run Property Set to use with follow up data flow when executeDataFlowFollowUpAction is specified. |
|
|
List of email recipients when sendEmailFollowUpAction is specified. |
Response Fields
None
Example request
PUT /api/v4/simple-scheduled-tasks/object:!tenant:defaultTenant~directory:workspace-id~simple-scheduled-task-v4:simple-scheduled-task-v4-id?ltk=AUTHENTICATION_TOKEN HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Type: application/json;charset=UTF-8
Content-Length: 1230
Host: localhost:8080
{"id":"simple-scheduled-task-v4-id","name":"Schedule Name","description":"Schedule Description","enabled":false,"triggerProperties":{"cronExpression":"0 00 00 1 1/1 ? *","startDateTime":"Start Date is ISO 8601 format","endDateTime":"Start Date is ISO 8601 format"},"dataflowId":"dataflowId","dataflowLocator":null,"runPropertySet":{"id":null,"name":null,"runProperties":[{"name":"runPropertyName1","value":"runPropertyValue1","source":null,"dataType":null,"editorData":null,"managementData":null},{"name":"runPropertyName2","value":"runPropertyValue2","source":null,"dataType":null,"editorData":null,"managementData":null}],"parentRunPropertySetLocators":null,"lastKnownParentNames":null,"description":null},"searchPath":["object:!tenant:defaultTenant~directory:workspace-id"],"runAsUserLocator":"object:!tenant:defaultTenant~user:runAsUser","followUps":[{"condition":"SUCCEEDED","action":{"type":"executeDataFlowFollowUpAction","data":{"runPropertySet":null,"dataflowLocator":"object:!tenant:defaultTenant~directory:workspace-id~graph:followUpGraphId"}},"enabled":true},{"condition":"FAILED","action":{"type":"sendEmailFollowUpAction","data":{"emailDistributionList":["user1@company.com","user2@company.com"]}},"enabled":false}]}
Example response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 162
{
"status" : "OK",
"data" : {
"locator" : "object:!tenant:defaultTenant~directory:workspace-id~simple-scheduled-task-v4:simple-scheduled-task-v4-id"
}
}
Get a specified scheduled task
A GET
request returns the specified scheduled task.
Path Parameters
Parameter | Description |
---|---|
|
The object resource locator of the requested scheduled task. |
Request Parameters
Parameter | Description |
---|---|
|
The authentication token. |
|
Specifies the fields to return in the response. One or more of |
Response Fields
Path | Type | Description |
---|---|---|
|
|
The object resource locator of the requested scheduled task. |
|
|
Status of the response. One of: |
|
|
The identity of the scheduled task. It must be unique and will be allocated if not specified at creation. |
|
|
The name of the scheduled task. This must be unique in the container. |
|
|
The description of the scheduled task. |
|
|
true if schedule is enabled, defaults to true. |
|
|
The Run Property Set for the Scheduled Task |
|
|
A list of run properties. |
|
|
The name of the run property. |
|
|
The value of the run property. |
|
|
The name of the run property. |
|
|
The value of the run property. |
|
|
Trigger Properties e.g. 'cronExpression'. |
|
|
Quartz Cron Expression. |
|
|
The date and time when the schedule starts in ISO-8601 format. |
|
|
The date and time when the schedule ends in ISO-8601 format. |
|
|
List of follow up actions taken on completion of Data Flow execution. |
|
|
Specifies whether the follow up action is enabled or not. |
|
|
Condition on which to execute the follow up action. SUCCEEDED - execute if previous data flow succeeded, FAILED - execute if previous data flow failed. |
|
|
Action to take. |
|
|
Type of action: executeDataFlowFollowUpAction - execute a data flow, sendEmailFollowUpAction - send an email to a specified list of recipients. |
|
|
Information specific to the action. |
|
|
Locator of data flow to execute when executeDataFlowFollowUpAction is specified. |
|
|
Optional Run Property Set to use with follow up data flow when executeDataFlowFollowUpAction is specified. |
|
|
List of email recipients when sendEmailFollowUpAction is specified. |
|
|
Metadata for the resource. |
|
|
The resource locator that uniquely identifies the resource. |
|
|
The userid of the user that created the resource. |
|
|
The username of the user that created the resource. |
|
|
Creation time of resource in ISO-8601 format. |
|
|
The userid of the user that last modified the resource. |
|
|
The username of the user that last modified the resource. |
|
|
Last modification time of resource in ISO-8601 format. |
|
|
The resource locator that uniquely identifies the container resource. |
|
|
The resource type. |
|
|
The resource id. |
|
|
True if the resource id is universally addressable. |
Example request
GET /api/v4/simple-scheduled-tasks/object:!tenant:defaultTenant~directory:workspace-id~simple-scheduled-task-v4:simple-scheduled-task-v4-id?ltk=AUTHENTICATION_TOKEN&fields=object,metadata HTTP/1.1
Host: localhost:8080
Example response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 3002
{
"status" : "OK",
"data" : {
"metadata" : {
"createdByName" : "Created By User Name",
"modifiedByName" : "Modified By User Name",
"browsingMetadata" : {
"name" : "Scheduled Task",
"description" : "Scheduled Task"
},
"locator" : "object:!tenant:defaultTenant~directory:workspace-id~simple-scheduled-task-v4:scheduled-task-id-001",
"containerLocator" : "object:!tenant:defaultTenant~directory:workspace-id",
"createdBy" : "created-by-user-Id",
"createdOn" : "2023-05-31T03:10:08+0000",
"modifiedBy" : "modified-by-user-Id",
"modifiedOn" : "2023-05-31T03:10:08+0000",
"resourceId" : {
"objectType" : "simple-scheduled-task-v4",
"objectId" : "scheduled-task-id-001",
"universal" : false
},
"universalLocator" : null,
"universalContainerLocator" : null
},
"locator" : "object:!tenant:defaultTenant~directory:workspace-id~simple-scheduled-task-v4:scheduled-task-id-001",
"object" : {
"id" : "scheduled-task-id-001",
"name" : "Scheduled Task",
"description" : "Schedule Description",
"enabled" : false,
"triggerProperties" : {
"cronExpression" : "0 00 00 1 1/1 ? *",
"startDateTime" : "Start Date is ISO 8601 format",
"endDateTime" : "Start Date is ISO 8601 format"
},
"dataflowId" : "dataflowId",
"dataflowLocator" : "object:!tenant:defaultTenant~directory:workspace-id~graph:dataflowId",
"runPropertySet" : {
"id" : null,
"name" : "Scheduled Task",
"description" : null,
"runProperties" : [ {
"name" : "runPropertyName1",
"value" : "runPropertyValue1",
"source" : null,
"dataType" : null,
"encryptionType" : "NO_ENCRYPTION",
"editorData" : null,
"managementData" : null
}, {
"name" : "runPropertyName2",
"value" : "runPropertyValue2",
"source" : null,
"dataType" : null,
"encryptionType" : "NO_ENCRYPTION",
"editorData" : null,
"managementData" : null
} ],
"lastKnownParentNames" : null,
"parentRunPropertySetLocators" : [ ]
},
"searchPath" : [ "object:!tenant:defaultTenant~directory:workspace-id" ],
"runAsUserLocator" : null,
"followUps" : [ {
"condition" : "SUCCEEDED",
"action" : {
"type" : "executeDataFlowFollowUpAction",
"data" : {
"dataflowLocator" : "object:!tenant:defaultTenant~directory:workspace-idgraph%3AfollowUpDataFlowId",
"runPropertySet" : null
}
},
"enabled" : true
}, {
"condition" : "FAILED",
"action" : {
"type" : "sendEmailFollowUpAction",
"data" : {
"emailDistributionList" : [ "user1@company.com", "user2@company.com" ]
}
},
"enabled" : true
} ]
}
}
}
Get a list of scheduled tasks
A GET
request returns a list of scheduled tasks.
Path Parameters
None
Request Parameters
Parameter | Description |
---|---|
|
The container locator of the requested scheduled tasks. |
|
Specifies the fields to return in the response. One or more of |
|
An optional FIQL filter expression. Supports searching by the 'name' attribute. For example |
|
The authentication token. |
Response Fields
Path | Type | Description |
---|---|---|
|
|
The object resource locator of the requested scheduled task. |
|
|
Status of the response. One of: |
|
|
The identity of the scheduled task. It must be unique and will be allocated if not specified at creation. |
|
|
The name of the scheduled task. This must be unique in the container. |
|
|
The description of the scheduled task. |
|
|
true if schedule is enabled, defaults to true. |
|
|
The Run Property Set for the Scheduled Task |
|
|
A list of run properties. |
|
|
The name of the run property. |
|
|
The value of the run property. |
|
|
The name of the run property. |
|
|
The value of the run property. |
|
|
Trigger Properties e.g. 'cronExpression'. |
|
|
Quartz Cron Expression. |
|
|
The date and time when the schedule starts in ISO-8601 format. |
|
|
The date and time when the schedule ends in ISO-8601 format. |
|
|
List of follow up actions taken on completion of Data Flow execution. |
|
|
Specifies whether the follow up action is enabled or not. |
|
|
Condition on which to execute the follow up action. SUCCEEDED - execute if previous data flow succeeded, FAILED - execute if previous data flow failed. |
|
|
Action to take. |
|
|
Type of action: executeDataFlowFollowUpAction - execute a data flow, sendEmailFollowUpAction - send an email to a specified list of recipients. |
|
|
Information specific to the action. |
|
|
Locator of data flow to execute when executeDataFlowFollowUpAction is specified. |
|
|
Optional Run Property Set to use with follow up data flow when executeDataFlowFollowUpAction is specified. |
|
|
List of email recipients when sendEmailFollowUpAction is specified. |
Example request
GET /api/v4/simple-scheduled-tasks?container=object:!tenant:defaultTenant~directory:workspace-id&fields=object&filter=name%3D%3D'Schedule%20Name'<k=AUTHENTICATION_TOKEN HTTP/1.1
Host: localhost:8080
Example response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 4560
{
"status" : "OK",
"data" : {
"objects" : [ {
"locator" : "object:!tenant:defaultTenant~directory:workspace-id~simple-scheduled-task-v4:scheduled-task-id-001",
"object" : {
"id" : "scheduled-task-id-001",
"name" : "First Scheduled Task",
"description" : "Schedule Description",
"enabled" : false,
"triggerProperties" : {
"cronExpression" : "0 00 00 1 1/1 ? *",
"startDateTime" : "Start Date is ISO 8601 format",
"endDateTime" : "Start Date is ISO 8601 format"
},
"dataflowId" : "dataflowId",
"dataflowLocator" : "object:!tenant:defaultTenant~directory:workspace-id~graph:dataflowId",
"runPropertySet" : {
"id" : null,
"name" : "First Scheduled Task",
"description" : null,
"runProperties" : [ {
"name" : "runPropertyName1",
"value" : "runPropertyValue1",
"source" : null,
"dataType" : null,
"encryptionType" : "NO_ENCRYPTION",
"editorData" : null,
"managementData" : null
}, {
"name" : "runPropertyName2",
"value" : "runPropertyValue2",
"source" : null,
"dataType" : null,
"encryptionType" : "NO_ENCRYPTION",
"editorData" : null,
"managementData" : null
} ],
"lastKnownParentNames" : null,
"parentRunPropertySetLocators" : [ ]
},
"searchPath" : [ "object:!tenant:defaultTenant~directory:workspace-id" ],
"runAsUserLocator" : null,
"followUps" : [ {
"condition" : "SUCCEEDED",
"action" : {
"type" : "executeDataFlowFollowUpAction",
"data" : {
"dataflowLocator" : "object:!tenant:defaultTenant~directory:workspace-idgraph%3AfollowUpDataFlowId",
"runPropertySet" : null
}
},
"enabled" : true
}, {
"condition" : "FAILED",
"action" : {
"type" : "sendEmailFollowUpAction",
"data" : {
"emailDistributionList" : [ "user1@company.com", "user2@company.com" ]
}
},
"enabled" : true
} ]
}
}, {
"locator" : "object:!tenant:defaultTenant~directory:workspace-id~simple-scheduled-task-v4:scheduled-task-id-002",
"object" : {
"id" : "scheduled-task-id-002",
"name" : "Second Scheduled Task",
"description" : "Schedule Description",
"enabled" : false,
"triggerProperties" : {
"cronExpression" : "0 00 00 1 1/1 ? *",
"startDateTime" : "Start Date is ISO 8601 format",
"endDateTime" : "Start Date is ISO 8601 format"
},
"dataflowId" : "dataflowId",
"dataflowLocator" : "object:!tenant:defaultTenant~directory:workspace-id~graph:dataflowId",
"runPropertySet" : {
"id" : null,
"name" : "Second Scheduled Task",
"description" : null,
"runProperties" : [ {
"name" : "runPropertyName1",
"value" : "runPropertyValue1",
"source" : null,
"dataType" : null,
"encryptionType" : "NO_ENCRYPTION",
"editorData" : null,
"managementData" : null
}, {
"name" : "runPropertyName2",
"value" : "runPropertyValue2",
"source" : null,
"dataType" : null,
"encryptionType" : "NO_ENCRYPTION",
"editorData" : null,
"managementData" : null
} ],
"lastKnownParentNames" : null,
"parentRunPropertySetLocators" : [ ]
},
"searchPath" : [ "object:!tenant:defaultTenant~directory:workspace-id" ],
"runAsUserLocator" : null,
"followUps" : [ {
"condition" : "SUCCEEDED",
"action" : {
"type" : "executeDataFlowFollowUpAction",
"data" : {
"dataflowLocator" : "object:!tenant:defaultTenant~directory:workspace-idgraph%3AfollowUpDataFlowId",
"runPropertySet" : null
}
},
"enabled" : true
}, {
"condition" : "FAILED",
"action" : {
"type" : "sendEmailFollowUpAction",
"data" : {
"emailDistributionList" : [ "user1@company.com", "user2@company.com" ]
}
},
"enabled" : true
} ]
}
} ]
}
}
Delete a simple scheduled task
A DELETE
request deletes a simple scheduled task.
Path Parameters
Parameter | Description |
---|---|
|
The locator of the scheduled task to delete. |
Request Parameters
Parameter | Description |
---|---|
|
The authentication token. |
Request Fields
None
Response Fields
None
Example request
DELETE /api/v4/simple-scheduled-tasks/object:!tenant:defaultTenant~directory:workspace-id~simple-scheduled-task-v4:simple-scheduled-task-v4-id?ltk=AUTHENTICATION_TOKEN HTTP/1.1
Host: localhost:8080
Example response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 162
{
"status" : "OK",
"data" : {
"locator" : "object:!tenant:defaultTenant~directory:workspace-id~simple-scheduled-task-v4:simple-scheduled-task-v4-id"
}
}
Ad-hoc run of a simple scheduled task
A POST
request executes an ad-hoc run of a simple scheduled task.
Run property values can be overridden for this run only if required.
A failed execution plan state can be run again by specifying the execution plan state locator.
Path Parameters
Parameter | Description |
---|---|
|
The locator of the scheduled task to run. |
Request Parameters
Parameter | Description |
---|---|
|
The authentication token. |
Request Fields
Path | Type | Description |
---|---|---|
|
|
The locator for the execution plan state locator when re-running a failed execution plan state. |
|
|
The Run Property Set for the Scheduled Task |
|
|
A list of run properties. |
|
|
The name of the run property. |
|
|
The value of the run property. |
|
|
The name of the run property. |
|
|
The value of the run property. |
|
|
The concurrent execution strategy. |
Response Fields
Path | Type | Description |
---|---|---|
|
|
Object resource locator of execution plan state for run. Use with the Execution Plan States API to identify the state of the run. |
|
|
Status of the response. One of: |
Example request
POST /api/v4/simple-scheduled-tasks/run-now/object:!tenant:defaultTenant~directory:workspace-id~simple-scheduled-task-v4:simple-scheduled-task-v4-id?ltk=AUTHENTICATION_TOKEN HTTP/1.1
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded
ltk=AUTHENTICATION_TOKEN
Example response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 197
{
"status" : "OK",
"data" : {
"locator" : "object:!tenant:defaultTenant~directory:workspace-id~scheduled-task:simple-scheduled-task-v4-id~execution-plan-state:execution-plan-state-id"
}
}
Example request to re-run failed task
POST /api/v4/simple-scheduled-tasks/run-now/object:!tenant:defaultTenant~directory:workspace-id~simple-scheduled-task-v4:simple-scheduled-task-v4-id?ltk=AUTHENTICATION_TOKEN HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Type: application/json;charset=UTF-8
Content-Length: 338
Host: localhost:8080
{"executionPlanStateLocator":"object:!tenant:defaultTenant~directory:workspace-id~simple-scheduled-task-v4:simple-scheduled-task-v4-idexecution-plan-state:execution-plan-state-id","overriddenRunPropertySet":null,"overriddenSuccessDataflowRunPropertySet":null,"overriddenFailDataflowRunPropertySet":null,"concurrentExecutionStrategy":null}
Example request to run with overridden run property values
POST /api/v4/simple-scheduled-tasks/run-now/object:!tenant:defaultTenant~directory:workspace-id~simple-scheduled-task-v4:simple-scheduled-task-v4-id?ltk=AUTHENTICATION_TOKEN HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Type: application/json;charset=UTF-8
Content-Length: 584
Host: localhost:8080
{"executionPlanStateLocator":null,"overriddenRunPropertySet":{"id":null,"name":null,"runProperties":[{"name":"runPropertyName1","value":"overriddenrunPropertyValue1","source":null,"dataType":null,"editorData":null,"managementData":null},{"name":"runPropertyName2","value":"overriddenrunPropertyValue2","source":null,"dataType":null,"editorData":null,"managementData":null}],"parentRunPropertySetLocators":null,"lastKnownParentNames":null,"description":null},"overriddenSuccessDataflowRunPropertySet":null,"overriddenFailDataflowRunPropertySet":null,"concurrentExecutionStrategy":null}
Errors
See errors for details of the error response.
Error Code | Description | Arguments |
---|---|---|
lae.scheduler.invalidCronExpression |
The specified |
|
lae.scheduler.missingCronExpression |
The |
|
lae.scheduler.scheduledTaskNameNotUnique |
The specified |
|
lae.scheduler.scheduledTaskNameNotSpecified |
The |
|
lae.scheduler.scheduledTaskIdNotSpecified |
The |
|
lae.scheduler.executionPlanStateRunning |
The scheduled task could not be deleted as it is currently running. |
|