Scheduler
Scheduler is a Pipe for deferred event execution. It writes the event to the database with a specified execution time. When the scheduled time arrives, the Schedule Pipeline reads the event and starts processing it.
caution
The event passed to the Schedule Pipeline replaces $origin with the value of params.template of this pipe. The original $origin data will not be available — all required fields must be passed in advance through template.
Parameters
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
pipe_id | int | Yes | — | id of the pipe in the Schedule Pipeline where the event will land |
delay | int | No | PIPE_SCHEDULER_DELAY (60 sec) | Execution delay in seconds |
template | object | Yes | — | Data that will be written to $in and $origin of the event in Schedule. Supports templating |
Possible Errors
- Template processing error in
params.template
Example
{
"id": 801,
"type": "scheduled",
"params": {
"pipe_id": 1,
"delay": 10,
"template": {
"camp_id": "$origin.c_id",
"send_message_id": "$origin.send_message_id",
"ym_cmp_id": "$#in.data.ymCampaignId"
}
},
"outs": {
"success": 802,
"error": 803
}
}
After 10 seconds, the event will reach pipe 1 in the Schedule Pipeline with the data from template in $origin.