Create schedule

createSchedule(projectReference: String!, input: CreateScheduleInput!): Schedule!

Requires project.runs.write.

Arguments

ArgumentTypeRequired
projectReferenceString!Yes
inputCreateScheduleInput!Yes

Input fields

input

CreateScheduleInput

FieldTypeRequiredDescription
nameString!Yes
targetScheduleTargetInput!Yes
scheduleString!YesThe cron expression.
timezoneStringNoIANA time zone name.
runtimeTargetKindRuntimeTargetKindNo
runtimeTargetEnvironmentIdIDNo
runtimeTargetBranchIdIDNo
configJSONNoJSON object passed to each run.
timeoutSecondsIntNo
backoffLimitIntNo
concurrencyPolicyScheduleConcurrencyPolicyNo
maxRunsIntNoNull for no limit.
definitionSourceScheduleDefinitionSourceNomanual (default), or source to activate a source schedule, which requires sourceTriggerId, sourcePath and sourceHash.
sourceTriggerIdStringNo
sourcePathStringNo
sourceHashStringNo

Response

Returns Schedule!. Open the type for its fields and nested types.

FieldTypeDescription
idID!
projectIdID!
nameString!
statusScheduleStatus!
targetScheduleTarget!
scheduleString!The cron expression.
timezoneString!
runtimeTargetKindRuntimeTargetKind!

All fields of Schedule.

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

graphql
mutation CreateSchedule($projectReference: String!, $input: CreateScheduleInput!) {
  createSchedule(projectReference: $projectReference, input: $input) {
    id
    projectId
    name
    status
    createdAt
  }
}
json
{
  "projectReference": "example-project",
  "input": {
    "name": "Nightly report",
    "target": {
      "kind": "task",
      "id": "nightly-report"
    },
    "schedule": "0 2 * * *"
  }
}