Create Schedule
This creates a schedule for a Workflow. Requires permission to edit schedules.
{region} may be: na, cis, apac, latam, emea
Try it
curl --request POST \
--url 'https://api.na.electroneek.com/v1/orchestrator/schedule' \
--header 'Content-Type: application/json' \
--data '{"workflow_id": "","type": "direct","timezoneLocation": "","params": {"directDateTime": "2099-10-07T09:30:00","period": "hourly","hours": 0,"minutes": 0,"seconds": 0,"dayOfWeek": [0],"dayNumber": [""],"restriction": {"excludeDays": {"isEnabled": false,"value": [0]},"rangeStart": {"isEnabled": false,"value": {"hours": 0,"minutes": 0}},"rangeEnd": {"isEnabled": false,"value": {"hours": 0,"minutes": 0}}}},"isActive": false,"botRunner": {"robotId": "","busyPolicy": "queue","offlinePolicy": "fallback","displayName": ""}}'Authentication
Use an API Token from the Orchestrator → Integrations page. Send it as a bearer token: Authorization: Bearer <token>.
Request body
| Name | Type | Required | Description |
|---|---|---|---|
workflow_id | string | yes | ID of the workflow the schedule launches |
type | string (direct, repeatable) | yes | `direct` runs once, `repeatable` runs on a recurring period |
timezoneLocation | string | yes | IANA time zone, such as `America/Sao_Paulo` |
params | object | yes | When the schedule runs. For a `direct` (one-time) schedule, send only `directDateTime`. For a `repeatable` schedule, send `period` and the fields that period uses: * `hourly`: `minutes`, optional `restriction` * `daily`: `hours`, `minutes`, optional `restriction` * `weekly`: `dayOfWeek`, `hours`, `minutes` * `monthly`: `dayNumber`, `hours`, `minutes` * `custom`: `hours` (0 to 1000), `minutes`, `seconds`, optional `restriction`. Repeats at this interval, counted from when the schedule was created. |
isActive | boolean | no | Whether the schedule is enabled |
botRunner | object · nullable | no | The Bot Runner that runs this schedule. `null` uses the workflow's Bot Runner selection. |
Response
idstringSchedule ID
workflow_idstringID of the workflow the schedule launches
typestring (direct, repeatable)direct runs once, repeatable runs on a recurring period
timezoneLocationstringIANA time zone, such as America/Sao_Paulo
paramsobjectWhen the schedule runs. For a direct (one-time) schedule, send only directDateTime. For a repeatable schedule, send period and the fields that period uses:
hourly:minutes, optionalrestrictiondaily:hours,minutes, optionalrestrictionweekly:dayOfWeek,hours,minutesmonthly:dayNumber,hours,minutescustom:hours(0 to 1000),minutes,seconds, optionalrestriction. Repeats at this interval, counted from when the schedule was created.
directDateTimestringOne-time schedules only. Local date and time in timezoneLocation, formatted YYYY-MM-DDTHH:mm:ss, without a UTC offset or Z.
periodstring (hourly, daily, weekly, monthly, custom)Repeatable schedules only.
hoursinteger0 to 23 (0 to 1000 for custom).
minutesintegersecondsintegercustom only.
dayOfWeekarray of integerweekly only. One-element array, 0 = Sunday to 6 = Saturday.
dayNumberarray of stringmonthly only. One-element array with "1" to "31" or "last".
restrictionobjectOptional limits for hourly, daily and custom schedules. Disabled restrictions are ignored.
excludeDaysobjectWeekdays when the schedule doesn't run (0 = Sunday to 6 = Saturday). Excluding all seven days is rejected. Hourly, daily and custom schedules.
isEnabledbooleanvaluearray of integerrangeStartobjectStart of the allowed daily time window. Hourly and custom schedules. Must be earlier than rangeEnd.
isEnabledbooleanvalueobjecthoursintegerminutesintegerrangeEndobjectEnd of the allowed daily time window. Hourly and custom schedules.
isEnabledbooleanvalueobjecthoursintegerminutesintegerisActivebooleanWhether the schedule is enabled
botRunnerobject · nullableThe Bot Runner that runs this schedule. null uses the workflow's Bot Runner selection.
robotIdstringrequiredID of a Bot Runner assigned to the workflow. An unassigned Bot Runner is rejected with 400.
busyPolicystring (queue, cancel)requiredIf the Bot Runner is busy: queue waits for it, cancel cancels this occurrence.
offlinePolicystring (fallback, cancel)requiredIf the Bot Runner is offline: fallback uses another assigned Bot Runner, cancel cancels this occurrence.
displayNamestringBot Runner name, set by the server.
accountEmailstringEmail of the account that created the schedule
statusstring (completed, completed-with-errors)Result of the last execution. null before the first one.
nextRundate-time · nullableNext occurrence, in UTC. Also calculated for disabled schedules, so check isActive.
lastRundate-time · nullableLast execution, in UTC
lastErrorstring · nullableError of the last execution, if any
{
"id": "663d9083ea1ba2debc1c410f",
"workflow_id": "663d9083ea1ba2debc1c410d",
"type": "direct",
"timezoneLocation": "America/Sao_Paulo",
"params": {
"directDateTime": "2099-10-07T09:30:00"
},
"isActive": false,
"botRunner": null,
"accountEmail": "api-issuer@example.com",
"status": null,
"nextRun": "2099-10-07T12:30:00.000Z",
"lastRun": null,
"lastError": null
}No response body.
No response body.
No response body.
No response body.