> ## Documentation Index
> Fetch the complete documentation index at: https://skyvern.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a schedule for an agent

> Create a cron, fixed-interval or one-time schedule that runs the given agent automatically with a fixed set of parameters. An interval schedule first runs at first_fire_at, or one interval after creation. A one-time schedule runs once at run_at. Returns the stored schedule and its next upcoming run times.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/agents/{workflow_permanent_id}/schedules
openapi: 3.1.0
info:
  title: Skyvern API
  description: API for Skyvern
  version: 1.0.0
servers:
  - url: https://api.skyvern.com
    x-fern-server-name: Cloud
security: []
paths:
  /v1/agents/{workflow_permanent_id}/schedules:
    post:
      tags:
        - Schedules
      summary: Create a schedule for an agent
      description: >-
        Create a cron, fixed-interval or one-time schedule that runs the given
        agent automatically with a fixed set of parameters. An interval schedule
        first runs at first_fire_at, or one interval after creation. A one-time
        schedule runs once at run_at. Returns the stored schedule and its next
        upcoming run times.
      operationId: schedules_create
      parameters:
        - name: workflow_permanent_id
          in: path
          required: true
          schema:
            type: string
            title: Workflow Permanent Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowScheduleUpsertRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowScheduleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    WorkflowScheduleUpsertRequest:
      properties:
        cron_expression:
          anyOf:
            - type: string
            - type: 'null'
          title: Cron Expression
        interval_seconds:
          anyOf:
            - type: integer
              maximum: 2147483647
              minimum: 300
            - type: 'null'
          title: Interval Seconds
          description: >-
            Fixed elapsed interval between runs, in seconds. Mutually exclusive
            with cron_expression.
        first_fire_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: First Fire At
          description: >-
            First run of an interval schedule; later runs follow every
            interval_seconds from it. Must be in the future when changed.
            Defaults to one interval after creation.
        run_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Run At
          description: >-
            Run the agent once at this instant, ISO 8601 with a UTC offset, at
            least 60 seconds in the future. Mutually exclusive with
            cron_expression and interval_seconds; the schedule can be edited or
            canceled only until it fires.
        timezone:
          type: string
          title: Timezone
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
          default: true
        parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parameters
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      type: object
      required:
        - timezone
      title: WorkflowScheduleUpsertRequest
    WorkflowScheduleResponse:
      properties:
        schedule:
          $ref: '#/components/schemas/WorkflowSchedule'
        next_runs:
          items:
            type: string
            format: date-time
          type: array
          title: Next Runs
      type: object
      required:
        - schedule
      title: WorkflowScheduleResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    WorkflowSchedule:
      properties:
        workflow_schedule_id:
          type: string
          title: Workflow Schedule Id
        organization_id:
          type: string
          title: Organization Id
        workflow_permanent_id:
          type: string
          title: Workflow Permanent Id
        cron_expression:
          anyOf:
            - type: string
            - type: 'null'
          title: Cron Expression
        interval_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Interval Seconds
        first_fire_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: First Fire At
        run_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Run At
        dispatch_status:
          anyOf:
            - $ref: '#/components/schemas/OneTimeDispatchStatus'
            - type: 'null'
        workflow_run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow Run Id
        timezone:
          type: string
          title: Timezone
        enabled:
          type: boolean
          title: Enabled
        parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parameters
        temporal_schedule_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Temporal Schedule Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
          description: >-
            Who the schedule runs as; null for schedules created before owners
            were recorded.
        created_at:
          type: string
          format: date-time
          title: Created At
        modified_at:
          type: string
          format: date-time
          title: Modified At
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
      type: object
      required:
        - workflow_schedule_id
        - organization_id
        - workflow_permanent_id
        - timezone
        - enabled
        - created_at
        - modified_at
      title: WorkflowSchedule
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    OneTimeDispatchStatus:
      type: string
      enum:
        - pending
        - fired
        - canceled
        - failed
      title: OneTimeDispatchStatus
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Your Skyvern API key from https://app.skyvern.com/settings.
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.