Skip to content

Commit ed55572

Browse files
committed
added docs for new schedule run result
1 parent ce07868 commit ed55572

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

x-pack/plugins/task_manager/server/README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,34 @@ When Kibana attempts to claim and run a task instance, it looks its definition u
141141
## Task result
142142

143143
The task runner's `run` method is expected to return a promise that resolves to undefined or to an object that looks like the following:
144+
145+
|Property|Description|Type|
146+
|---|---|---|
147+
|runAt| Optional. If specified, this is used as the tasks' next `runAt`, overriding the default system scheduler. | Date ISO String |
148+
|schedule| Optional. If specified, this is used as the tasks' new recurring schedule, overriding the default system scheduler and any existing schedule. | { interval: string } |
149+
|error| Optional, an error object, logged out as a warning. The pressence of this property indicates that the task did not succeed.| Error |
150+
|state| Optional, this will be passed into the next run of the task, if this is a recurring task. |Record<string, unknown>|
151+
152+
### Examples
153+
144154
```js
145155
{
146156
// Optional, if specified, this is used as the tasks' nextRun, overriding
147157
// the default system scheduler.
148158
runAt: "2020-07-24T17:34:35.272Z",
149159

150-
// Optional, an error object, logged out as a warning. The pressence of this
151-
// property indicates that the task did not succeed.
152160
error: { message: 'Hrumph!' },
153161

154-
// Optional, this will be passed into the next run of the task, if
155-
// this is a recurring task.
162+
state: {
163+
anything: 'goes here',
164+
},
165+
}
166+
```
167+
168+
```js
169+
{
170+
schedule: { interval: '30s' },
171+
156172
state: {
157173
anything: 'goes here',
158174
},

0 commit comments

Comments
 (0)